Error: 'slice' called on an object that does not implement interface Blob.
See original GitHub issueI am previewing the image on page, and after clicking on save button I am uploading image + sending http data of other form fields.
The image gets uploaded successfully but when sending http request to save all data, the error occurs. “Error: ‘slice’ called on an object that does not implement interface Blob.” Tried a lot to solve this not got success.
Please help me on this.
Upload code:
Upload.upload({
url: 'myproject/controller/image_upload',
file: file,
method: 'POST',
sendFieldsAs: 'form'
}).progress(function (evt) {
var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
console.log('progress: ' + progressPercentage + '% ' + evt.config.file.name);
}).success(function (data, status, headers, config) {
console.log('file ' + config.file.name + 'uploaded. Response: ' + data);
}).error(function (data, status, headers, config) {
console.log('error status: ' + status);
})
Code to save form data
$http({
method: 'POST',
url: "myproject/controller/get_data",
data: $.param($scope.store),
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
})
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Submitting a file with jQuery.ajax gives TypeError
This results in the error TypeError: 'append' called on an object that does not implement interface FormData . What causes this error? It...
Read more >File input Blob.slice error
I create a simple object that contains all the inputs in key/value pairs - shown as the last log entry. I'm guessing this...
Read more >TypeError: 'append' called on an object that does not ...
TypeError : 'append' called on an object that does not implement interface FormData. var name=$('#element_name'). val(); var ofile=document. ...
Read more >'append' called on an object that does not implement interface ...
I m getting the below error while executting the ajax call with FormData in above code. TypeError: 'append' called on an object that...
Read more >TypeError: stepUp called on an object that does not ... - YouTube
jQuery : TypeError: stepUp called on an object that does not implement interface HTMLInputElement [ Beautify Your Computer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did you get a solution for this problem? I am facing the same problem while sending Input type=“file” value using Ajax. Your help is appriciated.
Found that you should just add “contentType: false, processData: false,” to your ajax request. Look at this https://stackoverflow.com/questions/19722920/submitting-a-file-with-jquery-ajax-gives-typeerror