Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Uploading File via CGI

Posted on 1997-03-10
1
Medium Priority
?
174 Views
Last Modified: 2013-12-25
Hi, I want to enable the visitor of my website to upload files. Therefore, I've got a form with a TYPE="FILE" field.
But I don't know the parameters of the field, nor do I know
what my CGI-script has to look like if the file being uploaded should be stored somewhere on the server.
0
Comment
Question by:vanbasco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Kallisti earned 100 total points
ID: 1827643
I had never heard of the tag you used before, and was quite
shocked when testing it and reading up on it to find that
it actually existed!

Anyway, to answer the question, it should be used as follows:

<FORM       ENCTYPE="multipart/form-data"
      ACTION="antest.cgi"
      METHOD=POST>
<INPUT TYPE="file" name="afile"><BR>
<INPUT TYPE="submit">
</FORM>

And the cgi script is simply passwd a multipart-mime
file in its STDIN.  an example of just getting this
and displaying it (which will almost ALWAYS look
messy) is:

#!/usr/bin/perl

read(STDIN, $incoming, $ENV{'CONTENT_LENGTH'});

print "Content-Type: text/html\n\n";

print "$incoming\n";


Hope this helps, and good luck...
0

Featured Post

URL rewriting in AWS CloudFront

A quick how-to guide to implement with a Lambda function!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question