------------------------------------------------
On Fri, 7 Feb 2003 10:32:12 -0600, "Dan Muey" <[EMAIL PROTECTED]> wrote:
> Hello all,
> Has any body done this/know how to dit/know if it's even possible??
>
>
> __SHORT VERSION__
> How do I / Is it possible to -- use Net::FTP to send a file to a remote server that
>isn't an actual file but rather a variable with the file's contents?
>
> EG ::
> $ftp->("$html_code","newfile.html"); # where $html_code actually holds html code
>instead of a filename or filehandle
>
> __LONGER VERSION__
>
> I had a similar situation with Mail::Sender before now I need to do the same thing
>with Net::FTP or a different module if this one can't do it :
>
> I need to ftp files to a remote server.
> Say they need to be named file.html and file.pdf.
>
> Here's the kicker ::
>
> both files' contents are not found in any file, rather they are generated by the
>script and stored in variables :
>
> EG -
>
> my $html_file_contents = "<html><body>Hello World</body></html>";
> my $pdf_file_contents = creat_pdf_version("$html_code_contents");
>
> This would let you do ::
>
> print "Content-type text/html\n\n";
> print $html_file_contents;
>
> or
>
> print "Content-type application/pdf\n\n";
> print $pdf_file_contents;
>
> and in the browser it would look right.
>
> I have also used the ever so handy Mail::Sender to use these variables and send them
>as file attachments as if they actually existed before.
>
> Any ideas/different modules/etc..
>
Though my understanding may not be complete, and it would take two scripts and may not
be portable off of *nix systems, I would think you could set up a named pipe that
would be the main script that "produced the file contents" upon request, while a
second and extremely simple script called Net::FTP using the named pipe as its "file
to upload"???
This is all rather new to me, and again my understanding may not be complete, but
certainly a discussion starting comment.......
http://danconia.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]