Skip to content

Commit

Permalink
Improve README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Ritouet committed Jan 8, 2014
1 parent fdb287d commit 172d8e2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
File uploader for Deployd [![NPM](https://nodei.co/npm/dpd-fileupload.png?compact=true)](https://npmjs.org/package/dpd-fileupload/)
=========================

###This module is higly unstable, use it at your own risk.

Module for Deployd to upload files.
Upload the files to a local folder (currently in the public folder to access them) and store the filenames in a collection.

__This module is higly unstable, use it at your own risk.__

Don't hesitate to [fill an issue](https://github.com/NicolasRitouet/dpd-fileupload/issues/new) if you find a bug or need a feature.


Expand All @@ -26,7 +28,7 @@ Usage
### Upload a file
Method POST or PUT (set content type to "multipart/form-data"), send "subdir" as request param to save the file in a sub directory

Demo available here: https://github.com/NicolasRitouet/dpd-fileupload-demo
Working demo available here: https://github.com/NicolasRitouet/dpd-fileupload-demo

### Get the list of files
Method GET
Expand All @@ -35,6 +37,16 @@ Method GET
console.log(result);
});

### Get one file
Since we upload the files into the /public folder, you can access your files like this:
http://localhost:2403/upload/subdir/filename.extension
replace:
- upload by the folder your set in the dashboard
- subdir by the value you set for subdir. (nothing if you haven't given a subdir param)
- filename.extension by the name of the file your uploaded

If you would like more security and some rights management to get the files, [fill an issue](https://github.com/NicolasRitouet/dpd-fileupload/issues/new) about this and I might work on this feature.


### Remove a file from filesystem and from collection
Method DELETE
Expand All @@ -51,8 +63,9 @@ GET of one item is planned. That would allow us to remove the upload directory f

Todo
----
- add tests
- improve demo
- add optional creatorId property
- add optional creatorId property and optional comment property
- check if file already exist (upload anyway and put a (1) in the filename or throw an error?)
- Response after upload is returned too soon, uploaded file is not in the returned response (add a "remainingFile" integer)
- Find a cleaner way to get the path of the upload directory
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dpd-fileupload",
"description": "File uploader for Deployd",
"version": "0.0.5",
"version": "0.0.6",
"author": "Nicolas Ritouet <[email protected]>",
"dependencies": {
"formidable": "~1.0.14",
Expand Down

0 comments on commit 172d8e2

Please sign in to comment.