473,378 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Help with uploading a file...

Six
Hi, I need some assistance again...

I have a simple upload form from manual that goes like this:

<form enctype="multipart/form-data" action="list.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>

list.php then searches "/upload" and lists all the files found in there.

Now, what I need is to tell it where to upload a file :)
By default, tutorial says, files are in /var/www/tmp.
My web server doesn't even have this directory.
I tried doing some search in various tmp folders but found none of the
uploaded files. I expected it to see in the directory from which I
executed the form.. but... umm... no. Nothing there as well.

Just whem I was about to to phpinfo(); to search for the patch for
storing temp uploaded files server crashed... damn shared hosting.
So I have to wait for admins to bring it back online...

By the way, I can't try 'move_uploaded_file($_FILE['something'...
because the PHP version installed is not > or == 4.1.0 :((
I think it's 4.0.6 but I don't think it's that important.
Suggested solution was "$HTTP_UPLOADED_FILE" if I recall right...
.... but that failed to work for me as well :((

Anyone has any ideas?

Thanks in advance,
Six
P.S. I was just trying to make a simple file upload script. Nothing
fancy. Just to allow several people to send something to me via web...
Jul 17 '05 #1
2 1734
Six wrote:
Hi, I need some assistance again...

I have a simple upload form from manual that goes like this:

<form enctype="multipart/form-data" action="list.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <input name="userfile" type="file">
<input type="submit" value="Send File">
</form>

list.php then searches "/upload" and lists all the files found in there.

Now, what I need is to tell it where to upload a file :)
By default, tutorial says, files are in /var/www/tmp.
My web server doesn't even have this directory.
I tried doing some search in various tmp folders but found none of the
uploaded files. I expected it to see in the directory from which I
executed the form.. but... umm... no. Nothing there as well.

Just whem I was about to to phpinfo(); to search for the patch for
storing temp uploaded files server crashed... damn shared hosting.
So I have to wait for admins to bring it back online...

By the way, I can't try 'move_uploaded_file($_FILE['something'...
because the PHP version installed is not > or == 4.1.0 :((
I think it's 4.0.6 but I don't think it's that important.
Suggested solution was "$HTTP_UPLOADED_FILE" if I recall right...
... but that failed to work for me as well :((

Anyone has any ideas?

Thanks in advance,
Six
P.S. I was just trying to make a simple file upload script. Nothing
fancy. Just to allow several people to send something to me via web...


The location where the file is stored is saved in
$_FILES['userfile']['tmp_name'].

To copy the file from this temporary directory to another location do this:
copy($_FILE['userfile']['tmp_name'], 'C:\' . $_FILE['userfile']['name']);

The file which is located at $_FILE['userfile']['tmp_name'] is deleted
after the script ends.
--
-------------------------------------------------------
Try this: SCA the Smart Class Archive for PHP
http://www.project-sca.org
-------------------------------------------------------
Jul 17 '05 #2
Six
-> Markus L. ->
The location where the file is stored is saved in
$_FILES['userfile']['tmp_name'].

To copy the file from this temporary directory to another location do this:
copy($_FILE['userfile']['tmp_name'], 'C:\' . $_FILE['userfile']['name']);

The file which is located at $_FILE['userfile']['tmp_name'] is deleted
after the script ends.


Please take a look at the part of my original post:
By the way, I can't try 'move_uploaded_file($_FILE['something'...
because the PHP version installed is not > or == 4.1.0 :((
I think it's 4.0.6 but I don't think it's that important.
Suggested solution was "$HTTP_UPLOADED_FILE" if I recall right...
... but that failed to work for me as well :((


:(
But thanks for trying to help.

Bay the way, I found the almost perfect solution at
http://www.maaking.com/index.php?loadpage=scripts

I acutally had to change only one single lettes, but that was the buggy
part that was driving me mad :) LOL I guess develeoper didn't test the
script onder PHP < 4.1.0 :)

--
http://www.extremko.co.uk

Super-extra-naj_naj-fenomenalni-ultra-magicni-virtuelni-
-svemirski-extremni-master-fantasticni-dzedaj sajt :o)

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
9
by: R. Rajesh Jeba Anbiah | last post by:
Q: How should I handle file upload? A: File uploading requires HTML form of content type "multipart/form-data". The file content has to be POSTed/submitted via the form and once the file is...
6
by: Shelly | last post by:
I have searched and have not gotten an understanding of $_FILES. I am trying to do an upload to a directory "tmpdir" on the server. I have a field defined as: File name: <input...
3
by: Mike | last post by:
Hi i have a problem in asp.ne i am uploading file to the server using htmlinput controls and every thing is o but i try to upload larger file to the server like more than 4 mb and about 10mb i got...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
5
by: hb | last post by:
Hi, In my ASP.Net application 'MyWebApp' , the mode="StateServer" in <sessionState> of Web.config file, and the ASP.NET State Service is set to start automatically on the server. But every...
0
by: Frederic Rentsch | last post by:
Some time ago I had managed to upload a small package to the Cheese Shop using the data entry template. Uploading is in two steps: first the text then the package file. When I had a new version it...
2
by: Velhari | last post by:
Hi all, I developed the following codes to implement the concept of Multiple file Uploading Process. Actually my goal in this implementation is to uploads the files onto the server and i have...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
2
by: ali | last post by:
i am trying to upload file to server and at server side i am using $_FILES to receive file and uploading. i want to make sure that file which has been selected by user actually exists and user...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.