Hi. For many years, I used 360Work's WebAssistant plug-in for uploading files via http with a multipart/form-data processor on the server side, but with the upgrade to Filemaker Pro 16, everything stopped working. The latest version of the plug-in was installed. I checked out their documentation which had a new command specific to file uploads, and conflicting syntax. Support at 360Works has confirmed that the functionality for this feature is currently broken and suggested that I use CURL with Filemaker's built-in "Insert from URL" command to upload the file. I tried it and couldn't get it working any better than the plug-in. (All attempts return results without any file information or the file actually being uploaded, so I know the request is reaching the server and the server is responding. It's just that no file information is being included in the transfer.) Then I read that due to security restrictions in Filemaker, you can't upload a file directly from the hard drive, but need to have it in a container field (Thanks wimdecorte, for all the pioneering you've already done on this. If you have time, I'd love to compare syntax.) so I did that. (360Works also had a function that did that, which I tried, but that didn't work, either - same results.) I'm thinking there may be a new security restriction in place that prevent Filemaker from uploading anything to a server through http, or any built-in commands. Can someone confirm this? Is there anyone out there that is successfully uploading a file to a server using Filemaker other than through an email attachment (which I know still works) with Filemaker 16 or greater? If so, what method are you using?
For a simple file http file upload using the 'Insert from URL' script step and with the file you want to upload being stored in a container field, then a basic script could look like:
... where in the Insert from URL script step you could set Target as a field or variable of your choice, and have the URL specified as the base URL of your target form processor , and the 'cURL options' calculation specified as:
In this case, the form processor would need to expect a file upload called 'fileToUpload' to be uploaded - that is the form file upload field name, rather than the actual file name.
I just tested this with a very simple php script acting as a form processor such as:
...where my uploaded file was successfully saved into the 'uploadtest' folder on the server.