|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: allowing form uploadingby true (Pilgrim) |
| on Oct 16, 2002 at 05:13 UTC ( #205637=note: print w/ replies, xml ) | Need Help?? |
|
Want to parse your very own attachment uploads without Now that you did that, you need to read what was received in perl. There are a ton of helpful modules which will do this for you 1000 times better than little ole me could convey, but you said virtual host, without a module. Again, i remind you of cgi-lib.pl, see above. Tinkering with multi-type forms isn't an entire waste of time. You start to see how MIME works which can be handy for custom email readers. To start, take a look at what perl is sending you. Self-testing is the best learning tool here. In particular take a look at your ENV variables when you upload a file to your test script. In particular, look at $ENV{'CONTENT_TYPE'}. $ENV{'CONTENT_TYPE'} has a boundary modifier, parse this. You will use the boundary to delimit the remainder of your form. Once you know the delimiter you can split your uploaded content into it's seperate parts and begin to hack away. Each part has a HEAD and a BODY. The head tells you the filename, and describes the content. The BODY is the content (i.e. your image, or file) described by the HEAD. The HEAD and BODY are seperated by \n\n jtrue
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||