in reply to Setting a type=file parameter in CGI.pm

http://search.cpan.org/~lds/CGI.pm-3.42/CGI.pm#CREATING_A_FILE_UPLOAD_FIELD
  • Comment on Re: Setting a type=file parameter in CGI.pm

Replies are listed 'Best First'.
Re^2: Setting a type=file parameter in CGI.pm
by Rodster001 (Pilgrim) on Jan 02, 2009 at 21:09 UTC

      Why do you want to set the field after it has been submitted? You can set a new value. The uploaded files are treated special by CGI.pm and I don't think you can set those (and I don't see a reason why you would want to).

        The reason to set after? To eliminate code redundancy. I have an existing, fairly complex subroutine and I have since added other functionality. The existing way takes input via a form submission, the new way adds a feature to "submit" via email. I want to share the same code between the two (one block of code to process email attachments the same way as file uploads via form). So, before I pass the CGI object to that existing subroutine I set everything the same way the form submission would. Works great... except file uploads.