Solved

File upload, via my HTTP to my anon FTP site

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
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)

730 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