?
Solved

File upload, via my HTTP to my anon FTP site

Posted on 1997-06-17
3
Medium Priority
?
224 Views
Last Modified: 2013-12-25
Hi

I want setup a CGI that can upload a file via our web browser (Netscape) to my anon FTP site, not my HTTP. All the CGI I looked were done to upload to the same directorie of the CGI. I want upload in my ftp site (ftp://....) via my HTTP site (http://...). I try some, but they were like I see  before. My server is running the Unix and support perl 5 (perl 4 to). And, I only know the base of the perl. If someone know were I can find one like I want or could write it for me (I don't think someone will do this!), I'll appreciate. A last thing, I try all those in CGI-RESSOURCE and no one fit.


Thanks!
0
Comment
Question by:internouille
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Expert Comment

by:julio011597
ID: 1828289
Usually these are unrelated tasks, so you should look for resources on doing ftp, stole routines from them, and put them in your program with routines for file upload.

Rgds, julio
0
 

Accepted Solution

by:
jdd2 earned 600 total points
ID: 1828290
Well,

I would open a connection to the ftp site, whereas it is on
your site or not.
Let's take the README file. Call is something like:

http://your.http.site/cgi-bin/yourcgi?file_to_ftp=README

I would do:

#!/usr/local/bin/perl -Tw
#
# yourcgi
#
use strict ;
use CGI ;
use LWP ;
$ENV{'PATH'} = '/your/bin' ;       # -T option...
my $input = new CGI ;              # Get the parameter
my $URL = "ftp::/your.ftp.site" . $input->param('file_to_ftp') ;
my $ua = LWP::UserAgent->new ;
my $res = $ua->request(HTTP::Request->new('GET',$URL)) ;
unless ($res->is_success) {
  &Your_Error_Subroutine ;
  exit ;
}
my $file = $res-content ;
print $file ;
exit ;

Hope this fit your request,          Jean-Damien.

0
 

Author Comment

by:internouille
ID: 1828291
Thank you, for this help!
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question