Reading/writing files

Is it possible to open a file from the net..and then write the data from that file to the users local drive?

If it is possible, could someone please provide me with some code to do it.

Thanks
wormboy__6Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
#!/usr/bin/perl
use LWP::Simple;
$rc = getstore("http://experts-exchange.com/Q.10242772", "localfile");
print status_message($rc) if( $rc != RC_OK );
0
wormboy__6Author Commented:
ok, how do i make this into a workable cgi?

Do i need a certain programme or compiler?
0
jhurstCommented:
I am assuming that you want something on the server to do this.  If this is the case then the answer is NO, for security reasons.  You would not want a web site to be able to write to your hard drive.  However, if the web-user installs a plug-in, or application then it is possible.  

ozo is suggesting a method that will owrk if the user is to run perl on his/her local machine.  I suspect you do not want to do this.  And, this would require that the user install perl.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

wormboy__6Author Commented:
well can you call windows api functions on the client from a perl script?

0
ozoCommented:
If the client is the one who is running the perl script.
0
wormboy__6Author Commented:
im talking about running a script on the net..and people connecting to it via their browser.

So if they did this...i couldnt get the client to perform api tasks ...or could i?

the client isnt running the script...the web server is
0
ozoCommented:
A program running on the server cannot perform api tasks on the client,
unless the client is running a program which performs the api tasks for it.
0
jhurstCommented:
I think that ozo and are saying the same thing, now.  The only thing I would add to wht he is saying is that you could install a plug in or application on the client machine the first time he comments and this could do what you want.  You can not do this in a transparent manner but you can certainly send him a file of an executable type that will later be used by files of a certain type sent to it.  The user will be told that the file type in uinrecognized and asked what to do with it.  You know the type of thing: like you get when you download something from the web.
0
wormboy__6Author Commented:
yeh i know...how about running a method from an activex component.

eg loading the mswinsck.ocx and making it listen.

In Visual Basic i would do it like this:

Winsock1.Listen

in a cgi script..how can i load an object and performa task with it..run a method

is it possible?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.