Need help deciphering file upload metadata field in form POST data

1 posts, 0 answers
  1. Hisham
    Hisham avatar
    1 posts
    Member since:
    Mar 2019

    Posted 09 Mar Link to this post

    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.

Back to Top