bleenco / ngx-uploader

Angular File Uploader
https://ngx-uploader.jankuri.me
MIT License
757 stars 349 forks source link

feat(upload): use strategy pattern for multipart/form-data or direct upload #392

Open retailify opened 6 years ago

retailify commented 6 years ago

Since we've got questions regarding uploading images directly to Amazon S3, we can use the strategy pattern to switch the behavior of ngx-uploader.class.ts.

Defaults to: multipart/form-data upload

ngx-uploader.class.ts #L225

Upload to AWS S3 Gist in relation to this Stack Overflow Question

see

391

285

bezigon commented 6 years ago

How to direct upload? Seems the multipart option is removed.

retailify commented 6 years ago

Please look at the example in the repository. All files are transfered as multipart upload. But not in one transfer (all files in one upload). Each file will uploaded as single multipart upload.

draeb commented 6 years ago

I like the idea of a strategy pattern switch. I mean, there are a bunch of ways to upload with all their own idiosyncrasies (AWS, Azure, fineuploader, blueimp, etc.)

For my purposes, allowing the implementer to create their own strategy pattern would be immensely useful as I have to work with a team that created a custom backend loosely based on the one of the common strategies... but not exactly.

exequiel09 commented 4 years ago

Any news on this?