PUT Operation #217

Open
opened 2016-05-24 02:18:18 +00:00 by inska · 7 comments
inska commented 2016-05-24 02:18:18 +00:00 (Migrated from github.com)

Hi,

Does ng2-file-upload support file uploading via PUT method? it seems that ng2-file-upload uploading POST method, but in my case, I need to upload via PUT method..

Option for change uploading method needed.

Can I do this?

Hi, Does ng2-file-upload support file uploading via PUT method? it seems that ng2-file-upload uploading POST method, but in my case, I need to upload via PUT method.. Option for change uploading method needed. Can I do this?
bergben commented 2016-05-24 09:39:50 +00:00 (Migrated from github.com)

Try setting uploader.options.headers, headers are set here, but I am not sure if that works. Please let me know.

Try setting uploader.options.headers, [headers are set here](https://github.com/valor-software/ng2-file-upload/blob/development/components/file-upload/file-uploader.class.ts#L323), but I am not sure if that works. Please let me know.
inska commented 2016-05-25 02:30:51 +00:00 (Migrated from github.com)
@bergben , Seems not working.. header not change method https://github.com/valor-software/ng2-file-upload/blob/development/components/file-upload/file-item.class.ts.
inska commented 2016-05-25 02:31:35 +00:00 (Migrated from github.com)

I want to change 'alias' and 'method' via options..

I want to change 'alias' and 'method' via options..
retrospectacus commented 2017-01-03 19:45:11 +00:00 (Migrated from github.com)

You can set the request method like this.

uploader.onAfterAddingFile = (item) => {
  item.method = "PUT";
}

Regards,

You can set the request method like this. ``` uploader.onAfterAddingFile = (item) => { item.method = "PUT"; } ``` Regards,
ahmed-anas commented 2017-04-24 19:38:06 +00:00 (Migrated from github.com)

For me, had to use onBeforeUploadItem

For me, had to use `onBeforeUploadItem`
PLPeeters commented 2018-05-01 10:49:26 +00:00 (Migrated from github.com)

You can simply use the method option as follows:

uploader: FileUploader = new FileUploader({
    url: UPLOAD_URL,
    method: 'PUT',
    // more options
})
You can simply use the `method` option as follows: uploader: FileUploader = new FileUploader({ url: UPLOAD_URL, method: 'PUT', // more options })
yaxx commented 2019-01-20 07:23:48 +00:00 (Migrated from github.com)

How do i add other user input like first name and last name to in addition to the file to be send to the server

How do i add other user input like first name and last name to in addition to the file to be send to the server
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#217