-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload file to CouchDB #88
Comments
To upload to CouchDB you gotta send a request with the content type of the file and the file content so you don't need to use $upload.upload() which will send a multipart form data request. Just use regular angular Here is an example of how to do it: |
The FileReader api is gonna be supported in the next release of FileAPI around February 14. Once it is released I will integrate it with angular-file-upload so that FileReader will be supported cross browser with the FileAPI polyfill. |
Ok. So the issue it that the backend needs to handle multipart fomr data requests and CouchDB doesn't? If I use |
Sounds good with inbuilt support for the FileReader API 👍 |
Oh I see, so you basically want to get the progress event from angular with this library. I can add another service method to just send a regular I let you know once it is done. |
Yes! That sounds exactly like what I need. Then I'd be able to use the directives, and the other great features in a way compatible with CouchDB. Thanks a lot for your great support and for creating this library :-) |
version 1.2.0 now supports this:
|
Super sweet! Thanks a lot for implementing this feature it works flawlessly! I figured out that this syntax works as well which I prefer:
Thanks again! |
Hi! I got a backend that does not support multipart either, so im using the .http() method. @danialfarid is there a way to stream the file? $upload.upload() seem to do it... Thanks!! |
There are workarounds using file.slice() but it is not embedded in the plugin. |
Ok issue created! |
i have one question this is my false code
}); |
Hello how i change to Multiple File Input Fields in One Form |
@altaihero Please create a separate New Issue. This issue is closed and your question is not related to this one. |
I have a scenario in which i have the file upload control in a popup |
I'm trying to upload an image with the following code:
I'm uploading the file to CouchDB (which I don't think matters since CouchDB doesn't do any processing on the file) and the uploaded file end up with the content type "application/json". I fixed that by setting the headers manually with
And outcommenting the line in the angular-file-upload source that sets the content type to undefined. This fixes the content type, and sets it correctly according to the filetype but the uploaded file still ends up on the server in some corrupted form that won't show correctly in the browser.
The text was updated successfully, but these errors were encountered: