Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > CGI file upload missing from STDIN

Reply
Thread Tools

CGI file upload missing from STDIN

 
 
Mark
Guest
Posts: n/a
 
      11-28-2005
Hello.

I am beginning to experiment with HTML forms and CGI.
I have an HTML form that uploads a file using the
multipart/form-data encoding and the POST method.
The form target is a simple Perl script which opens a file and
writes out the data that it received via STDIN.

The output file shows all the various inputs from my
HTML form, except for the file stream. Any idea
why the file isn't showing up?

Of course, I will use the CGI module for any
serious work.

Thanks
-Mark


 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      11-28-2005
Mark wrote:
> The output file shows all the various inputs from my
> HTML form, except for the file stream. Any idea
> why the file isn't showing up?


Because your code is buggy. But we can't really help you, since you
didn't show us your code!

 
Reply With Quote
 
 
 
 
Mark
Guest
Posts: n/a
 
      11-28-2005
<(E-Mail Removed)> wrote:
> Because your code is buggy. But we can't really help you, since you
> didn't show us your code!
>


But if I show you my code, you might mock me.


 
Reply With Quote
 
Bengt-Arne Fjellner
Guest
Posts: n/a
 
      11-28-2005

<(E-Mail Removed)> wrote in
news:(E-Mail Removed) ups.com...
> Mark wrote:
>> The output file shows all the various inputs from my
>> HTML form, except for the file stream. Any idea
>> why the file isn't showing up?

>
> Because your code is buggy. But we can't really help you, since you
> didn't show us your code!
>


As there is VERY little data i can just guess.
how does your form tag look? it should be "multipart/form-data" to work
<form method="post" action="/cgi-bin/pars" enctype="multipart/form-data">


 
Reply With Quote
 
Keith Keller
Guest
Posts: n/a
 
      11-28-2005
On 2005-11-28, Mark <(E-Mail Removed)> wrote:
><(E-Mail Removed)> wrote:
>> Because your code is buggy. But we can't really help you, since you
>> didn't show us your code!

>
> But if I show you my code, you might mock me.


Is it better to be mocked but get specific help, or to be mocked but get
no help?

If you post a short-but-complete script replicating the problem, with
use strict and use warnings, then there shouldn't be too much to mock
you over.

--keith

--
http://www.velocityreviews.com/forums/(E-Mail Removed)-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information

 
Reply With Quote
 
A. Sinan Unur
Guest
Posts: n/a
 
      11-28-2005
"Mark" <(E-Mail Removed)> wrote in news:raadnS239uOhyBbenZ2dnUVZ_s-
http://www.velocityreviews.com/forums/(E-Mail Removed):

> <(E-Mail Removed)> wrote:
>> Because your code is buggy. But we can't really help you, since you
>> didn't show us your code!
>>

>
> But if I show you my code, you might mock me.


Your code will be critqued. It is up to you to decide whether getting help
with your problem is worth the hassle.

As it stands, it is not worth for us to waste time trying to help you.

Please see the posting guidelines for this newsgroup to learn how you can
help yourself, and help others help you.

Sinan
--
A. Sinan Unur <(E-Mail Removed)>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/cl...uidelines.html

 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      11-28-2005
Mark wrote:
> I am beginning to experiment with HTML forms and CGI.
> I have an HTML form that uploads a file using the
> multipart/form-data encoding and the POST method.
> The form target is a simple Perl script which opens a file and
> writes out the data that it received via STDIN.
>
> The output file shows all the various inputs from my
> HTML form, except for the file stream. Any idea
> why the file isn't showing up?
>
> Of course, I will use the CGI module for any
> serious work.


Try the CPAN module CGI::UploadEasy. Among other things, it helps you
detect common mistakes in connection with file uploads.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      11-28-2005
Ok, I was editing my sample code for posting purposes,
and I discovered that the file input statement preceded my
opening FORM tag. Problem solved (buggy HTML form.)

Having a bunch of people telling me to look at my code
again was, in fact helpful. Thank you!

-Mark


 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      11-28-2005
"Gunnar Hjalmarsson" <(E-Mail Removed)> wrote:
>
> Try the CPAN module CGI::UploadEasy. Among other things, it helps you
> detect common mistakes in connection with file uploads.


Good suggestion, thanks. Yes, I will definitely use the CGI:: module
if I proceed with this. So far I just wanted to do something educational
(which it was), and produce a quick proof-of-concept for a client.

-Mark


 
Reply With Quote
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      11-28-2005
Mark wrote:
> Ok, I was editing my sample code for posting purposes,
> and I discovered [the problem]


I've done that many times! If you post according to the guidelines,
you will often discover your answer before you even post the question.

Cheers.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
peek at stdin, flush stdin Johnathan Doe C Programming 5 05-17-2013 04:30 PM
How to pass stdin of a C++ program to the stdin of a process createdwith ShellExecute() Ben C Programming 2 08-29-2009 09:47 PM
STDIN, OUT, ERR and $stdin, out, err - Differences? Terry Cooper Ruby 7 06-09-2009 05:48 AM
Reading from stdin then launching a program that reads from stdin strange behaviour Stefano Sabatini Perl Misc 6 07-29-2007 10:38 PM
Reading stdin once confuses second stdin read Charlie Zender C Programming 6 06-21-2004 01:39 PM



Advertisments