Currently, I am using Vue.js and Axios to send form data to a specific link. However, I encountered an issue where the file is not being sent and I am receiving an error message.
The parameter 'file' had the following problems: file transferred without multipart should be base64 encoded
I attempted to resolve this by modifying the data.append('file', url) by adding another parameter like data.append('file', url,{type:'pdf'}). Unfortunately, this resulted in an error stating that the second parameter is not a blob. The root cause of this problem lies in using a URL instead of a file, which cannot be changed as the API documentation requires sending form data with a file. As a workaround, I am trying to replace the file with a live URL.
var data = new FormData();
var url= 'https://storage.cloudconvert.com/xxxxx.pdf';
data.append('name','file')
data.append('filename', 'amjad');
data.append('file', url);
data.append('saved', 'true');
data.append('type', 'pdf');
axios.post('myapiurl',data, {
headers: {
'Content-Type': 'multipart/form-data'
},
}).then(res => {
console.log(res);
})