Solved

setting upload file's location

Posted on 2004-03-22
7
265 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 51

Expert Comment

by:ahoffmann
Comment Utility
$file = 'C:/uploaded_files/ ' . $file;
0
 
LVL 48

Accepted Solution

by:
Tintin earned 250 total points
Comment Utility
or

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

0
 
LVL 9

Expert Comment

by:ronan_40060
Comment Utility
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
Comment Utility
ronan_40060, this question deals with a form provided by the web server, no script on the client
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to dynamically set the form action using jQuery.

771 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

9 Experts available now in Live!

Get 1:1 Help Now