Internal error 500 on upload file from REST API

cancel
Showing results for 
Search instead for 
Did you mean: 
ni0ni0s
Member II

Re: Internal error 500 on upload file from REST API

Jump to solution

postman and form-data working nice.

postman and raw json not working. same error.

ni0ni0s
Member II

Re: Internal error 500 on upload file from REST API

Jump to solution

Untitled.png

abhinavmishra14
Advanced

Re: Internal error 500 on upload file from REST API

Jump to solution

I see the problem, your request is not able to pass the file content with the request. Passing file path in json payload won't work. I am not much familier with PHP so not 100% sure. You can check if the content is being passed properly. When sending the form data from postman, it was able to send the file content.

If you want to use raw json data only then you can use base64 encoded string formation of the file data in the request alternatively. 

 

~Abhinav
(ACSCE, AWS SAA, Azure Admin)
Sujeet1999
Member II

Re: Internal error 500 on upload file from REST API

Jump to solution

Can you please share the POSTMAN request?

I tried form data, it is saying BAD Request - "Required parameters are missing". Not sure what I am missing here.

Here is my postman form-data

Capture.PNG

Sujeet1999
Member II

Re: Internal error 500 on upload file from REST API

Jump to solution

postman and form-data working nice.

@ni0ni0s - Please help me out by sharing your postman request.

abhinavmishra14
Advanced

Re: Internal error 500 on upload file from REST API

Jump to solution

Looks like you are manually placing the file path as string. It will not work. File has to be attached. This is how we select a file in Postman. Rest of the params could be as is.

select filedata.png

~Abhinav
(ACSCE, AWS SAA, Azure Admin)