Comments (31)
I have not create a adapter for local filesystem, but it's very easy to create an adapter.
- Create the upload function:
orion.filesystem.providerUpload = function(options, success, failure) {
/**
* Here you will recive the file in the variable options.fileList.
*
* You have to upload the file using the method you want.
*
* If the file was uploaded successfully call success(fileUrl, optionalData)
* The optionalData will be saved in the meta variable
*
* If not call failure(error).
*/
}
- Create the remove function:
orion.filesystem.providerRemove = function(file, success, failure) {
/**
* Here you will recive the file object, containing the url and
* the optionalData in file.meta.
*
* You have remove the file.
*
* If the file was removed successfully call success()
*
* If not call failure(error).
*/
}
You can see an example here https://github.com/orionjs/s3/blob/master/lib/main.js
from orioncms.
If you create an adapter please upload it to atmosphere so everyone can use it!
from orioncms.
I'll see if I have time the next days, thank you for the answer.
from orioncms.
Is this implemented now 😉?
from orioncms.
No, its not. Just answered the question
from orioncms.
Then there's a missing ticket for the actual feature, right?
from orioncms.
Nope, just answered your question. You said you're going to do it
from orioncms.
"I'll see if I have time the next days, thank you for the answer." not seeing anything that states that I would do it. But it's your decision after all.
from orioncms.
Ok, lets leave this open better
from orioncms.
Any news concerning this file upload on the local filesystem?
Any example on how to bind this with https://github.com/aldeed/meteor-cfs-autoform maybe?
from orioncms.
@rdewolff using another provider has nothing to do with autoform. Just fill the functions! It's super-easy, give it a shot. I haven't read cfs docs, but the solution might be similar to this:
orion.filesystem.providerUpload = function(options, success, failure) {
CFS.uploadFile(options.fileList, function(error, response) {
if (error) {
failure(error)
} else {
success(response.url, { localPath: response.localPath })
}
})
}
orion.filesystem.providerRemove = function(file, success, failure) {
CFS.removeFile(file.meta.localPath, function(error, response) {
if (error) {
failure(error);
} else {
success();
}
})
}
If you put that code in your app (of course that will not work because it's not the real cfs api) all file inputs will use that functions to upload files
from orioncms.
Am trying to use FS.Collection to do this but it's not working. I got problems to handle the file upload and calling the success function.
Could your provide a more detailed example please?
from orioncms.
cf. https://github.com/CollectionFS/Meteor-CollectionFS
from orioncms.
Seems that the "success" function called at the end of the file upload is not accepting URL with Port number!
from orioncms.
Here is the code am using : https://gist.github.com/rdewolff/5777563b491ac27544ec
from orioncms.
Can you make a pull request on filesystem to accept files with port? It currently uses SimpleSchema.RegEx.Url to check.
https://github.com/orionjs/filesystem/blob/master/lib/collection/init.js
from orioncms.
Actually it's not the port number causing problem, but a host name without ".com" or "dot something".
from orioncms.
Any updates on this implementation. I am willing to work with someone if they would like to collaborate to come up with a solution.
from orioncms.
@rwatts3 I think @rdewolff solution might work with the new update of filesystem https://github.com/orionjs/filesystem/commit/de9ad944f7ba2fa4163b2a97e79213c7db3e1db8 (Don't check urls)
from orioncms.
ok so I should just update filesystem and remove orionjs:s3
and it should work ?
from orioncms.
If the only thing that was preventing @rdewolff solution to work was the checking of the urls, it should work.
from orioncms.
Hmm , ok I will give this a shot. @rdewolff When ever you have the solution solved are you planning on creating an extension package ? such as orionjs:filesystem-local
from orioncms.
Thanks @nicolaslopezj for updating the url type to String. The error concerning localhost has been already reported earlier, cf Meteor-Community-Packages/meteor-simple-schema#239.
Concerning the file upload on file system, I think a simple package would be great. Let's do that!
from orioncms.
@rdewolff I will be willing to work with you to create a package if that is okay with you. Let me know what ideas you have.
from orioncms.
@rdewolff Could you post a gist on the code you are using to get this working. I tried to view the gist posted earlier but for some reason it's not available anymore.
Thanks
from orioncms.
@nicolaslopezj are you planning on doing the official extension for this ? if you are i'd like to work with you and assist. I would do it myself but would like to make sure it'd done the correct way with your insight on future extension of orionjs
from orioncms.
I'm not going to make a official extension. But if anyone make one, I would help.
from orioncms.
hey @rwatts3 - here is the gist for the file upload. Notice is just a basic implementation to support single file upload and there is no delete method implemented yet.
https://gist.github.com/rdewolff/84ed3f3be3f24f58c1db
from orioncms.
Will Orionjs v1.0 include the local filesystem feature? The current implementation has no delete method and every time I upload an image, the page will automatically refresh and then display the right image.
from orioncms.
Just now I made a package that includes delete method. But the code is not so good-looking. After all it works. Hope it's helpful for the release of official local filesystem package.
https://gist.github.com/loongmxbt/da2b361785ca6f9ad574
PS: Still have some bugs. In remove cannot find the fileObj.
Fix the bug, now can delete file on local server. Files.remove(cfs_id) not an FS.file obj.
https://github.com/loongmxbt/orion-lfs
from orioncms.
https://github.com/lc3t35/orion-filesystem-local
from orioncms.
Related Issues (20)
- Cant install orionjs:core HOT 1
- App crashes in ios and android
- can't list accounts HOT 1
- cant't list collection HOT 1
- Hide create, update or delete buttons not working HOT 2
- [email protected] depency broken HOT 1
- Is this project dead? HOT 5
- Website down
- Crash when creating default admin user Error: Match error: Expected string, got object HOT 1
- attribute 'hasMany' does not exist... HOT 2
- TypeError: Cannot read property 'orderable' of undefined HOT 3
- Error when trying to meteor add orionjs:core HOT 3
- Error while try to installing orionjs:core into a fresh app
- How to use orionjs:pages HOT 1
- Orion Pages cant be edited
- Error: You must pass Tabular.Table instance as the table attribute HOT 2
- orion.filesystem.remove on server side
- orion:base is incompatible with the latest roles package
- http://docs.orionjs.org/ is down HOT 3
- i18n new languages not resetting trackers and helper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orioncms.