Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ Thanks. If you changed it to "MultipartData"->{{"image", "multipart/form-data" , Import["test.jpg", "Byte"]}} Do you still get the same results? $\endgroup$ Commented Oct 23, 2015 at 17:08
  • $\begingroup$ @SimonO'Doherty I get error messsages, I can't evaluate that. However I can say that the data is submitted correctly with the header Content-type set to multipart/form-data for the version that is in my post. It's just that for some reason the file is not sent as a file. I can also say that I tried it that but with the image represented by bytes and it didn't work. $\endgroup$ Commented Oct 23, 2015 at 18:36
  • $\begingroup$ I'm not familiar with simple PHP script and Mathematica code combinations like that you created in your answer. Would it be correct to assume that upload.php in the URLFetch first argument of your Mathematica code block is in fact the PHP script in your PHP code block? I'm also guessing that with the URLFetch hack present the JPG image file shows up in both dollar-sign_REQUEST and dollar-sign_FILES, instead of just in the dollar-sign_REQUEST variable. Correct? $\endgroup$ Commented Oct 29, 2015 at 18:12
  • $\begingroup$ @ChristopherHaydock Yes, correct, upload.php is the code I have given. Wen it works correctly, as it does with the hack, the file only shows up in the array $_FILES. $\endgroup$ Commented Oct 29, 2015 at 18:31