Hello everyone,
I’m running into a bit of a problem with a workflow I’m trying to complete at work.
I’m reading some data from a document and then passing that information into a form in Safari. That part works fine.
The form creates another form with a file upload button; I can’t seem to figure out how to successfully manipulate that via Safari, so if anyone has any ideas or suggestions I’d love to hear them.
I did some research and I think that doing this through Safari is not possible, so I looked into the possibility of uploading the file via HTTP by using Curl. I figured out that I’d need to log on first and get cookies set up, so that part is done.
I’m trying to pass the following command to upload the file “test1.jpg”
curl -b cookies.txt -F “filefield=@/test1.jpg;type=image/jpg” -F “aiimage2=cj216200993826PM.jpg” http://holiday.____.com/admin/photoupdate_upload.asp
The form’s file identifier is “filefield”, and “aiimage” is an identifier for the filename that will be used after the image has been uploaded (their server renames files to avoid duplications and so forth)
However, when I execute this command with the verbose mode on, this is what gets returned:
- About to connect() to holiday._____.com port 80 (#0)
- Trying 216...*… connected
- Connected to holiday._______.com (216...*) port 80 (#0)
POST /admin/photoupdate_upload.asp HTTP/1.1
User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
Host: holiday._____.com
Accept: /
Cookie: ASPSESSIONIDQQQRRQSA=NIPEJFMDHOFHMOALLFKCHJFG
Content-Length: 67174
Expect: 100-continue
Content-Type: multipart/form-data; boundary=----------------------------113569baa18b
< HTTP/1.1 100 Continue
< Server: Microsoft-IIS/5.0
< Date: Tue, 17 Feb 2009 03:16:16 GMT
< HTTP/1.1 500 Internal Server Error
< Server: Microsoft-IIS/5.0
< Date: Tue, 17 Feb 2009 03:16:17 GMT
< Content-Length: 351
< Content-Type: text/html
< Cache-control: private
<
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '='.
I’m not sure what the problem is since everything else seems to be working swimmingly. This is the only thing that’s holding up my applescript from working! Any ideas/suggestions would be very very welcome.