0

I want to upload two files to a web service, one CSV file with metadata inside and one tiff image. The CSV file and the tiff files are are a pair, because the CSV file contains metadata for the tiff file. So they always need to be uploaded together I have the javascript working on an uploading server

    var xhr = new XMLHttpRequest();
    var formData = new FormData();
    xhr.open('POST', '/GigaTEMUpload/UploadFiles', true);
    xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

    files.forEach(function (file, i) {
        formData.append('uploadFiles[' + i + ']', file);
    });
    xhr.send(formData);

but if I want to use python request to do the same post job how to do it through python? Thanks

I am using python from a server running spyder to upload two files to a web. And once they are uploaded the tiff image would be viewable on the web.

Phani Mahesh
  • 85
  • 1
  • 13
Wen Tong
  • 23
  • 3

1 Answers1

0

It's a pretty normal outbound request. Here is a similar question for your reference, Send file using POST from a Python script

Phani Mahesh
  • 85
  • 1
  • 13