File uploads in loopback

5,465 views
Skip to first unread message

Abbas Mousavi

unread,
Feb 26, 2014, 5:17:37 PM2/26/14
to loopb...@googlegroups.com
Loopback  documentation (http://docs.strongloop.com/display/DOC/LoopBack) says: "...  apps can upload files" and recently a class named LBFile has added to iOS client, but there is no documents about uploading files.

1 - Can I define a "file" field in my loopback model?
2 - Can I upload files using Javascript client?
3 - Can I choose to store files on file system or database?

Raymond Feng

unread,
Feb 26, 2014, 7:51:15 PM2/26/14
to Abbas Mousavi, loopb...@googlegroups.com
The file/storage service and SDK APIs are yet to be released. We’re working on tidying up the features, testing the functions, and documenting the APIs. Stay tuned.

For a quick preview, the upcoming release for the file/storage service will consist of a few components:

1. A Node.js that is integrated into the LoopBack applications that allow you to upload/download files/blobs to/from various storage systems, such as file system, Amazon S3, Rackspace cloud files. The providers are pluggable. You can write your own too. It also manages the metadata as container/file objects.

2. LBFile APIs in the iOS and Android SDKs.

3. The file/storage service is exposed as REST APIs. The upload protocol is based on multipart/form-data mime type over HTTP, which is the one that browsers support for the file fields. The JavaScript can use the HTML5 file upload library too.

Thanks,
Raymond

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Abbas Mousavi

unread,
Mar 5, 2014, 2:18:48 AM3/5/14
to loopb...@googlegroups.com, Abbas Mousavi
Thanks Raymond

When is the estimated time of release for this features?

Raymond Feng

unread,
Mar 5, 2014, 2:28:06 AM3/5/14
to Abbas Mousavi, loopb...@googlegroups.com
Hi,

I just made https://github.com/strongloop/loopback-storage-service public. Feel free to check it out for preview. Please be aware that the module has NOT been officially released. 

There are examples under the example folder. You can use them as the starting point. 

Feedbacks are welcome.

Thanks,
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, clustering and support for private registries.

gyss

unread,
Nov 16, 2014, 5:10:54 AM11/16/14
to loopb...@googlegroups.com, abbasm...@gmail.com
Hi,

I'm really interested in file upload from AngularJS.


I've spotted these plugins for Angular:

https://github.com/danialfarid/angular-file-upload

https://github.com/nervgh/angular-file-upload

But I don't have any idea in how manage this on the server-side with Loopback.

Is Loopback-storage-service released? Coud I make it work with the client plugins linked above?

Thanks

gyss

unread,
Nov 16, 2014, 6:13:43 AM11/16/14
to loopb...@googlegroups.com, abbasm...@gmail.com
Wow!

just realized the example in the loopback-storage-service

https://github.com/strongloop/loopback-component-storage/tree/master/example-2.0

Great!


On Wednesday, March 5, 2014 8:28:06 AM UTC+1, Raymond Feng wrote:

Miroslav Bajtoš

unread,
Nov 18, 2014, 4:55:54 AM11/18/14
to loopb...@googlegroups.com, abbasm...@gmail.com
On Sunday, November 16, 2014 12:13:43 PM UTC+1, gyss wrote:
just realized the example in the loopback-storage-service

https://github.com/strongloop/loopback-component-storage/tree/master/example-2.0

FWIW, there is a GitHub issue requesting a first-class support for files and containers in the LoopBack SDK for AngularJS:


Although it was not our priority so far.

Miroslav

Kristóf Mihály

unread,
Mar 6, 2015, 3:54:10 AM3/6/15
to loopb...@googlegroups.com, abbasm...@gmail.com
Struggling with the same issue. Could you pls provide what kind of solution you ended up with?
So we can have this solved once and for all.

al...@havenmx.com

unread,
Jun 26, 2015, 6:57:37 PM6/26/15
to loopb...@googlegroups.com, abbasm...@gmail.com
The example 2.0 is pretty helpful. I also created a gist of the bare minimum I needed to do to get file upload working with `ng-file-upload`, because I was struggling for a bit to figure it out: https://gist.github.com/reichert621/e987545fdbc2bc071d37

Raymond Feng

unread,
Jun 26, 2015, 7:12:10 PM6/26/15
to loopb...@googlegroups.com, abbasm...@gmail.com
Thanks, Alex.

Thanks,

---
Raymond Feng
Co-Founder and Architect @ StrongLoop, Inc.

StrongLoop makes it easy to develop APIs in Node, plus get DevOps capabilities like monitoring, debugging and clustering.

-- 
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.

ashish...@magicsw.com

unread,
Nov 9, 2015, 1:05:49 AM11/9/15
to LoopbackJS, abbasm...@gmail.com
Hi Raymond,

Using this loopback component I able to upload file with in a folder inside of a bucket. But I am not able to download a file from a folder. Please suggest a way around...

Raymond Feng

unread,
Nov 9, 2015, 1:43:39 AM11/9/15
to loopb...@googlegroups.com, abbasm...@gmail.com
GET /api/containers/myContainer/files/myFile should do.

Sent from my iPhone 6 Plus
Reply all
Reply to author
Forward
0 new messages