Skip to content

allow upload of blob #208

Closed
Closed
@bettysteger

Description

@bettysteger

hey I just used https://github.com/alexk111/ngImgCrop to crop an image before uploading.. and now I did this to upload the blob with angular-file-upload:

  uploader.onBeforeUploadItem = function(item) {
    var blob = dataURItoBlob($scope.croppedImage);
    item._file = blob;
  };

This works just fine, but the file name is ignored because of this line: (and because of that the server doesn't recognize the file extension)

form.append(item.alias, item._file);
-->
------WebKitFormBoundaryGD5fYyZwXHVXxfZ4
Content-Disposition: form-data; name="avatar"; filename="blob"
Content-Type: image/png

It would be possible to add the name as third parameter, see https://developer.mozilla.org/en-US/docs/Web/API/FormData

what do you think of adding a third parameter or allow to upload a Blob in the first place?

btw: you made a really cool plugin!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions