in reply to Macs and File Uploads

Okay, while I'm not exactly sure where you are having problems, I think I can help you out ... When submitting a file upload via HTTP, a multi-part request must be made by the client - For example ...

<form action="/cgi-bin/..." enctype="multipart/form-data" method="post +"> ... </form>

This type of request submits the form field information and the 7-bit encoded file via POST, separated by a boundary separator that delimits these two sections. The CGI parameter from the file field will contain the name of the file, while the file itself must be parsed from the request separately - A lot of this magic is hidden in the init and read_multipart subroutines of CGI.pm, based upon RFC1867.

It should also be noted that the value of the file field form parameter is platform dependent and as such, it cannot be depended upon to return both directory and filename of the uploaded file.

As such, if you are using your own CGI parameter parser, it is more than likely that you are simply not extracting this information from the submitted POST - This is another reason why it is better to use CGI.pm rather than a hand-rolled parser based upon cgi-lib.pm (see use CGI or die;).

 

Replies are listed 'Best First'.
Re: Re: Macs and File Uploads
by Cody Pendant (Prior) on Jun 19, 2002 at 01:36 UTC
    Thank you for that. I get it now.

    I think the thing I was also missing is that it's not the CGI script or module's business where on the disk the file is, that's the browser's business.

    The fact that different platforms display different info in the field of the form is neither here nor there.
    --

    ($_='jjjuuusssttt annootthheer pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;