in reply to CGI upload from ajax

More than likely it's because your POST does not have the correct MIME type .. file uploads need to be multipart/form-data (and you're probably defaulting to application/x-www-form-urlencoded). Rather than doing this yourself, I would suggest one of the many JQuery file upload plugins.

-derby

Replies are listed 'Best First'.
Re^2: CGI upload from ajax
by flope004 (Acolyte) on Feb 04, 2009 at 14:53 UTC

    Thank you all for the fast replies!

    I added this line:
    contentType: "multipart/form-data",
    to the ajax part but still not working...I am getting the following error
    Malformed multipart POST: data truncated
    I will search for other options but I am still surprised why it shouldn't work.

      Right ... use a plugin ... you have to construct the html in such a way that the browser will do the right thing. Most of the plugins will wrap your html with the proper html snippets.

      -derby

        I couldn't make them work. I try a few and none of them work. All the examples are based on php in the server side. So, when I change the php for my cgi I am getting the same errors or even none.....:-( I don't know

        thanks