in reply to Uploading files to server

oky

that worked thanks alot

now if im correct i only have to add a part that copys the

file to a safe place so is'nt deleted after uploaded, right??

# Read a text file and print it out while (<$file>) { print; # Copy a binary file to somewhere safe open (OUTFILE,">>/usr/local/web/users/feedback"); while ($bytesread=read($file,$buffer,1024)) { print OUTFILE $buffer; } }
is it this???

Calilo

thanks alot Hopes

Replies are listed 'Best First'.
Re: Re: Uploading files to server
by cfreak (Chaplain) on Oct 15, 2001 at 19:40 UTC
    You don't need the first part:
    while (<$file>) { print;

    Just the second part:

    # Copy a binary file to somewhere safe open (OUTFILE,">>/usr/local/web/users/feedback"); while ($bytesread=read($file,$buffer,1024)) { print OUTFILE $buffer; } close(OUTFILE); #Always make sure to close the file or it won't work.

    Also make sure that the directory you write to has write permissions by the webserver and finally make sure the HTML form you have to do the uploading has type="multipart/form-data" in the form tag.

    Hope that helps. UPDATE: That should be enctype="multipart/form-data"