You can do the upload with a form. Read any HTML reference and check out the
<input type="file"> tag. The web server will store the uploaded file as a
temporary file. Your form handler will have to store it someplace permanent.
This is pretty simple using the CGI module. Check out the CGI module
documentation for complete details.

Once you've got the file on your machine, you can either save the whole file
in the database as a BLOB, though I've never done that. I just leave the
file in a directory and store the name of the file in the database. A lot
simpler, really, though you have to remember to delete the file when you
delete the record.

Hope this helps . . .

-- John

> -----Original Message-----
> From: Mariusz [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 20, 2002 8:35 PM
> To: perl
> Subject: file upload to MySql
>
>
> I need to upload a file to a database. Could someone tell me how
> to do it? I know how to insert values into a table and upload
> files to a directory but how to combine the two correctly so the
> file gets uploaded to my MySql DB and I don't get any errors. A
> part of a script that does that would be a great help...
>
> thank you,
> M
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to