Solved

File upload, via my HTTP to my anon FTP site

Posted on 1997-06-17
3
217 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
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 150 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now