Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 22nd, 2013, 03:45 PM
Squire4Hire Squire4Hire is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 4 Squire4Hire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 m 25 sec
Reputation Power: 0
Handling files from HTML POST method with Perl

Please excuse my ignorance. It's my first time working with Perl and I'm finding it to be quite different from what I'm used to and rather difficult to wrap my head around.

I'm hoping someone out there might be able to point me in the right direction on how this particular problem might be handled - or even tell me that it can't. So here goes...

I have 'inherited' a Perl script that receives form data from a website, packages the data into a file and emails that file to a specified address. Being that Perl is renowned for handling textual data, it's a good fit. I'm looking to expand it a bit in the hopes that I will also be able to handle attached files that will also be emailed to the specified address.

I was planning to use no more than 3 INPUT type="file" tag in my HTML, allowing the user to select files from their computer. The problem I'm having is figuring out how to capture the files in the Perl script and to attach them with the existing $smtp->datasend commands.

Any help would be hugely appreciated. Thanks.

Reply With Quote
  #2  
Old January 25th, 2013, 09:23 PM
admiraln admiraln is offline
Still Learning
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Location: Montreal, Canada
Posts: 55 admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level)admiraln User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 18 h 57 m 51 sec
Reputation Power: 38
Use CGI.pm features
See http://www.daniweb.com/software-development/perl/threads/69164/basic-perl-web-upload-script#

For an example.

Reply With Quote
  #3  
Old January 26th, 2013, 09:25 AM
FishMonger FishMonger is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2009
Posts: 1,645 FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level)FishMonger User rank is General 3rd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 22 h 51 m 15 sec
Reputation Power: 1170
It might be best to point the OP to the actual CGI documentation rather than an extremely short and questionable file upload example.

perldoc CGI

Here's a better and more complete tutorial on the file upload process.
How to Upload Files using the CGI.pm Module and Perl

Quote:
The problem I'm having is figuring out how to capture the files in the Perl script and to attach them with the existing $smtp->datasend commands.

I assume you're using the Net::SMTP module.

It would be much easier to use one of the higher level email modules, such as MIME::Lite, for attaching the files and sending the email.
Comments on this post
admiraln agrees!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Handling files from HTML POST method with Perl

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap