This is a migrated thread and some comments may be shown as answers.

Need help deciphering file upload metadata field in form POST data

0 Answers 5 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Hisham
Top achievements
Rank 1
Hisham asked on 09 Mar 2019, 02:29 PM

Hello,

I'm trying to upload some file programmatically from a python script thru one of our forms but I've hit a stumbling block.

When I check the Web Inspector, I see that file uploads trigger a multi-part form POST that includes the below field:

ctl00_ContentPlaceHolder1_uFile_ClientState:
{  
   "isEnabled":"true",
   "uploadedFiles":[  
      {  
         "fileInfo":{  
            "FileName":"test.xlsx",
            "ContentType":null,
            "ContentLength":9365,
            "DateJson":"2019-03-08T16:00:12.472Z",
            "Index":0
         },
         "metaData":"long string of random gibberish"
      }
   ]
}

And this is where I'm having difficulties. If I copy the metadata field from the web inspector, and test using the same file that I used at the time, then it works. But if I try uploading another file then it fails. And I guess that it's because I am not updating the metadata field accordingly.

So, can someone help explain to me what goes into that field? And how is it encoded?

Any insight you could share would be greatly appreciated.

No answers yet. Maybe you can help?

Tags
Documentation and Tutorials
Asked by
Hisham
Top achievements
Rank 1
Share this question
or