Click here to get back home

file upload

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
file upload kalikoi 01-05-2006
| |--> Re: file upload Gunnar Hjalmars...01-05-2006
|   ---> Re: file upload Gunnar Hjalmars...01-05-2006
|     | ---> Re: file upload Gunnar Hjalmars...01-05-2006
|     |     |--> Re: file upload Gunnar Hjalmars...01-06-2006
|     |     `--> Re: file upload Martin Vorlaend...01-06-2006
|     `--> Re: file upload Gunnar Hjalmars...01-05-2006
`--> Re: file upload Gunnar Hjalmars...01-05-2006
Posted by Gunnar Hjalmarsson on January 6, 2006, 1:51 am
Please log in for more thread options


Jim Gibson wrote:
> Gunnar Hjalmarsson wrote:
>> Paul Lalli wrote:
>>> Gunnar Hjalmarsson wrote:
>>>>
>>>> s#.*[\]:\/]##;
>>>
>>> Out of curiousity, what type of system uses the ] character as a path
>>> separator?
>>
>> According to the File::Basename POD: VMS. I have never seen it IRL,
>> which is one reason why I asked. :)
>
> As I recall, it is a directory termination character, actually, and '.'
> is the path separator. For example, a full path name might be:
>
> [dira.dirb.dirc]filename.typ

Thanks for the correction. The above s/// expression still ought to
serve the purpose of extracting the actual file name, right?

> (it's been many, many years since I worked on VMS, however).

Disclaimer noted. ;-)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


Posted by Martin Vorlaender on January 6, 2006, 8:47 am
Please log in for more thread options


> As I recall, it is a directory termination character, actually, and '.'
> is the path separator. For example, a full path name might be:
>
> [dira.dirb.dirc]filename.typ

In fact, a complete VMS filename looks like

node"login info"::device:[path.to.file]filename.type;version

For each of the fields, there's some default (e.g. node"login info"::
defaults to local node with no login info needed, the default for
the device is the current device, etc.).

VMS' C RTL (and thus Perl) understand Unix notation (with the leading
path element being the device).

cu,
Martin
--
| Martin Vorlaender | OpenVMS rules!
Microsoft's answer | work: mv@pdv-systeme.de
to OpenVMS is | http://www.pdv-systeme.de/users/martinv/
Windows NT 10.0. | home: martin@radiogaga.harz.de


Posted by Gunnar Hjalmarsson on January 5, 2006, 9:15 pm
Please log in for more thread options


Gunnar Hjalmarsson wrote:
> ... when designing a file upload request, File::Basename don't ...

s/request/app/;
s/don't/doesn't/;

Sorry.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


Posted by Jim Gibson on January 5, 2006, 10:56 am
Please log in for more thread options



> Hi
>
>
> I'm using the following code for PDF file upload via perl
>
>
> The code is working.
>
>
> but the file size is zero bytes
>
>
> any suggestions

I answered the same question that you posted on comp.lang.perl.misc.
Please do not multi-post.

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Posted by Gunnar Hjalmarsson on January 5, 2006, 6:38 pm
Please log in for more thread options


kalikoi@gmail.com wrote:
> I'm using the following code for PDF file upload via perl
>
> The code is working.
>
> but the file size is zero bytes
>
> any suggestions

Use the CPAN module CGI::UploadEasy. Among other things, it checks for
common mistakes with respect to file uploads.

#!/usr/local/bin/perl -T
use strict;
use warnings;
use CGI::Carp 'fatalsToBrowser';
use CGI::UploadEasy;

my $uploaddir = '/path/to/upload/directory';

my $ue = CGI::UploadEasy->new(-uploaddir => $uploaddir);
my $cgi = $ue->cgiobject;
my $info = $ue->fileinfo;

print $cgi->header, $cgi->start_html,
$cgi->p('Files uploaded: ', keys %$info),
$cgi->end_html;
__END__

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


Similar ThreadsPosted
file upload, multipart form, and cgi::cache April 21, 2006, 7:01 am
File::FilterFuncs almost ready to upload to CPAN. January 18, 2007, 10:22 pm
Net:TFTPd questions - Want to upload configs via TFTP July 20, 2006, 12:29 pm
Choosing a good namespace for a module to upload to CPAN July 14, 2004, 1:46 pm
install HTML::Template - Problem reading cache file / Bad file number July 24, 2004, 7:55 pm
Reading contents of an excel file from a test file May 15, 2007, 2:49 am
A do-file location: how the code inside that do-file find it? January 20, 2008, 12:32 am
DBD:mysql doesn't read mysql option file /etc/my.cnf file January 27, 2005, 11:19 pm
Win32::File August 29, 2004, 9:08 pm
SGI::FAM and File::PathConvert June 14, 2005, 10:58 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap