Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Content-Disposition: Form-data and attachment

I am building out an apache HttpClient for a REST service I have, and a app that will be using my service is sending a POST request using "content-disposition: attachment; name="file"; filename="file.txt".

Currently my Client is using "Content-Disposition: form-data; name="file"; filename="test.txt". Currently my request is multipart/mixed, where I am sending a file, and JSON.

Ideally I would need to have my client using the attachment one, but after much research, I have not found anything meaningful. What exactly is the difference between the two content-dispositions?

like image 920
sparky123 Avatar asked Apr 10 '26 11:04

sparky123


1 Answers

Attachment is for responses, form-data is for requests. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition

like image 129
inf3rno Avatar answered Apr 13 '26 09:04

inf3rno



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!