• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

file upload

Is there a way to have a user choose a file to upload and then have the perl script go get it from the local computer? I don't want to have to use a browser interface. I have a Visual Basic program that allows users to select a file from their computer to upload. The only problem is getting the perl script to upload it without having to deal with the clumsy web browser.
0
microfleet
Asked:
microfleet
  • 2
  • 2
1 Solution
 
khacharnCommented:
what you can do is get all the files the USER choosees in an array and the
parse the directory for each array and if the file is found for that array name then upload it..
regards
Nitin
0
 
microfleetAuthor Commented:
But upload it how? I know how to use a browser to upload to a perl scipt, but how do I tell the perl script to upload it to itself? Normally, the browser initiates the upload and performs the client end of the process while the perl script handles the server side, but what if there is no browser to deal with; how then can script accept a file for upload?
0
 
khacharnCommented:
Once the User has selected the files to be uploaded..you can initiate a perlscript(on the server) which uses the LWP::SIMPLE module to fetch the file from the LOCAL PC..HOW ??
Every computer that logs on to the INTERNET has an IP address.
you can capture that IP address thru any scripting language(javascript eg)
Then you can pass the ip address of the client PC and the pathof the file he wants to upload..as parameters to the perl script on your server..this perlscipt will then use the LWP::SIMPLE module function get to get that file..
sample code
***************************************
Use LWP::Simple;
my filepath = <ARGV[0]>;
my IPadd = <ARGV[1]>;
$filefetched = get "ipaddressofClient+pathoffile";
***************************************
hope this helps you..
Write to in detail if you want more help..
be more clear
Regards
Nitin
0
 
microfleetAuthor Commented:
khacharn, great insight! Works just the way I wanted..thanks!
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now