Page 1 of 1

Upload image from a URL instead of local file system?

Posted: Tue Jan 20, 2015 4:40 am
by Andrew Davidsburg

Is it possible to save an image from a url to the database as opposed to uploading a file from a local filesystem? ie input http://upload.wikimedia.org/wikipedia... and upload it to the database.

Thanks!


Upload image from a URL instead of local file system?

Posted: Tue Jan 20, 2015 7:36 am
by Alena Prykhodko

Hello Andrew,

Yes, this is possible.
You can even generate your file on "fly".
Current DB Files collection provides API to save file if you have binary content.
If you can get file binary content via url, then you will succeed.


Upload image from a URL instead of local file system?

Posted: Tue Jan 20, 2015 4:22 pm
by Andrew Davidsburg

Thanks Alena,

HAving a little trouble making this work. Can you clarify how I would input the binary data into the database?

Thanks!

Andrew


Upload image from a URL instead of local file system?

Posted: Tue Jan 20, 2015 10:08 pm
by Andrew Davidsburg

To clarify I've got the files in base64 format but I keep getting the error below?Is there additional info that needs to be sent with the data? I have decoded the data elsewhere with no issues. Thanks!

{"code":"BCXX002","description":"Cannot consume content type"}


Upload image from a URL instead of local file system?

Posted: Tue Jan 20, 2015 10:48 pm
by Andrew Davidsburg

Just found this from Yuri, going to give it a shot.
https://getsatisfaction.com/apperyio/...