content-disposition

how to set Content-disposition header as attachment for file part?

how to set Content-disposition header as attachment for file part? Question: I am using the Python requests module to send a multi-part HTTP POST request that contains both form-data and a file attachment. The “Content-disposition” header for each multi-part object is set to “form-data”, including the file part. I need the “Content-disposition” header for the …

Total answers: 2

how to determine the filename of content downloaded with HTTP in Python?

how to determine the filename of content downloaded with HTTP in Python? Question: I download a file using the get function of Python requests library. For storing the file, I’d like to determine the filename the way a web browser would for its ‘save’ or ‘save as …’ dialog. Easy, right? I can just get …

Total answers: 3