cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Upload file through PHP app

From: jj <jj_at_macscripter.net>
Date: Tue, 03 Aug 2004 13:22:55 +0200

> On Mon, 2 Aug 2004, jj wrote:
>
>>> What exactly does "without success" mean? What curl version are you using?
>
>> Mac OS X 10.3.4, curl version 7.10.2
>
> Gosh, that is an ooold version.

Yep ;-) I must use this version, as it is the one which ships built-in in
the OS...
 
>> The trace seems OK, but the form is not sent, and the file is not uploaded.
>
> Ehum. Let's not confuse matters. The data you see in the trace is what was
> sent. That is a multipart formpost. Sure, you may not have succeeded, but the
> post and the file was sent to the server.

True. I was meaning that the data was not post-processed in the server (but
it was uploaded, ok)
 
>> The page I receive as answer is the same with the upload form, with the
>> fields filled with the provided values, and it should be a different page,
>> with a preview of the new entry in the database.
>
> And this isn't because you lack a necessary cookie? It sure sounds like it.
> Try using LiveHTTPHeaders to figure out what your browser sends when you do
> this.

Thanks for pointing to this tool... It is really useful!

I think I solved the problem partially... Finally, seems that the only hard
error in my script is that it is uploading any file as "text/plain" file
type, instead of "application/x-stuffit" (if a .sit file) or
"application/zip" (if a .zip file), which are some the allowed types in the
PHP page.

>From the "trace" file...

Content-Type: text/plain

Is there any switch or option which makes the file to be uploaded as the
correct "Content-Type"?

Content-Type: application/zip

jj

-- 
http://www.macscripter.net/
http://www.osaxen.com/
Received on 2004-08-03