Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

setting upload file's location

Posted on 2004-03-22
7
Medium Priority
?
294 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
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.

 
LVL 51

Expert Comment

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

Accepted Solution

by:
Tintin earned 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

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…
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

963 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