upload file with perl cgi

S

Sokar

I am designing a new feature to a services web page for the user to upload
screen dumps of problems onto my server for inspection and maybe further
use.

I have investigated the <input TYPE='file' NAME='pic' size='15'> for use in
the html part.

The problem comes when I get to the perl cgi part of the code, I am havin
problems saving the .jpg onto my server.

Can anyone provide a little help on how to upload files onto the server via
a web interface?

Thanks

John
 
B

Brian McCauley

I am designing a new feature to a services web page for the user to upload
screen dumps of problems onto my server for inspection and maybe further
use.

I have investigated the <input TYPE='file' NAME='pic' size='15'> for use in
the html part.

What was the outcome of the investigation?
The problem comes when I get to the perl cgi part of the code, I am havin
problems saving the .jpg onto my server.

What sort of problems? (Random shot-in-the-dark: did you forget binmode()?).
Can anyone provide a little help on how to upload files onto the server via
a web interface?

perldoc CGI

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 
A

A. Sinan Unur

(e-mail address removed) (Sokar) wrote in
I am designing a new feature to a services web page for the user to
upload screen dumps of problems onto my server for inspection and
maybe further use.

I have investigated the <input TYPE='file' NAME='pic' size='15'> for
use in the html part.

The problem comes when I get to the perl cgi part of the code, I am
havin problems saving the .jpg onto my server.

Can anyone provide a little help on how to upload files onto the
server via a web interface?

<http://tinyurl.com/3byux> (http://search.cpan.org/~lds/CGI.pm-
3.05/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD)

<http://www.catb.org/~esr/faqs/smart-questions.html>
 
S

Sean Berry

I do a file upload in part of a script I wrote.

This is the code for the input field:
<input type="file" name="filename" size=40 maxlength=64 accept="pdf/*">

Then, in an upload subroutine I do something like this:
$pdfdir = "/admin/ppv_pdfs";
$x = file_upload($filename, $pdfdir);

You don't need to do "$x =" if all you do is upload the file. But, if you
can use the return value then it could be helpful as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top