Solved

setting upload file's location

Posted on 2004-03-22
7
267 Views
Last Modified: 2013-12-25
Hi,

From a web page that I have created, I am trying to upload a file and put it into a specific location in my computer.


how can I set a location for this uploading process "for example under c:/...." what is the source code look like?

right now, I am using windows OS

thank you in advance

cem
0
Comment
Question by:cemaykan
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10652868
the web server cannot set the path on the client
you only can try to use client-side scripting, like JavaScript, ActiveX etc.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10653329
For upload, I think you really mean download.  Upload means sending a file from your computer up to the webserver.  Download is the opposite.

Anyway, ahoffman has already answered your question (unless you really did mean upload)
0
 

Author Comment

by:cemaykan
ID: 10660398
I am sorry for the misunderstanding about my question. Let me explain what I am doing in more detail.

I have created a webpage, and I have a server working behind it.

The users logged into that page,
the page is:
<HTML>
<HEAD>File Upload</HEAD>
<BODY>
<FORM ACTION="upload2.cgi" METHOD="post" ENCTYPE="multipart/form-data">
File to Upload: <INPUT TYPE="file" NAME="files"> <br><br>
<INPUT TYPE="submit" NAME="Submit" VALUE="Upload File">
</FORM></BODY></HTML>

and send their files to the server.

#!/usr/bin/perl
use CGI;
$q = new CGI;
$file = $q->param('files');
print $q->header;
mkdir "$file";
print "File name is: $file";

This code uploads the file to the same place where the .cgi file is, right?

My question is, how can I set the files location to somewhere else? for ex. it is under a directory called perl_project, but I want to move it to a directory with the path C:/uploaded_files/

Sorry again for the undetailed question.

thank you

cem
 

   

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 10661822
$file = 'C:/uploaded_files/ ' . $file;
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
ID: 10663155
or

$file="C:/uploaded_files/$file";

0
 
LVL 9

Expert Comment

by:ronan_40060
ID: 10768681
hello cem
Im doing the similar thing writing a perl script to upload it to the server
but Im stuck with upload.pl
howz ur upload.pl working?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 10776174
ronan_40060, this question deals with a form provided by the web server, no script on the client
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.

929 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

13 Experts available now in Live!

Get 1:1 Help Now