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
Solved

setting upload file's location

Posted on 2004-03-22
7
276 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
DevOps Toolchain Recommendations

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

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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