473,387 Members | 1,624 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,387 software developers and data experts.

put $_FILES into a session

Hello,

I'm trying to get my $_FILES arrays into a session because I want to
move the files later to a specific directory (ie after I get a result_id
from a sql insert). No problem putting the variables in a session but I
can't move $_SESSION['userfile']['tmp_name'] anymore.
$_SESSION['userfile']['error'] is 0 so I don't really see what could be
the problem....

Anybody can help?

Trogie
Jul 17 '05 #1
2 4356
On Fri, 30 Apr 2004 02:49:10 GMT
Tom Rogie <To*@Rogie.be> wrote:
Hello,

I'm trying to get my $_FILES arrays into a session because I want to

move the files later to a specific directory (ie after I get a
result_id from a sql insert). No problem putting the variables in a
session but I can't move $_SESSION['userfile']['tmp_name'] anymore.
$_SESSION['userfile']['error'] is 0 so I don't really see what could
be the problem....


I don't really see the problem. After upload, get the name of the
file, move it somewhere safer and after you're ready to delete the
file, delete file saved its name or do whatever you want with it.

if ( move_uploaded_file ( $filename, ´/safe/place') )
$_SESSION['file']='/safe/place'.$filename;

Maybe I didn't understand your question.

Jul 17 '05 #2
Hi Tom,

On Fri, 30 Apr 2004 02:49:10 GMT, Tom Rogie <To*@Rogie.be> wrote:
Hello,

I'm trying to get my $_FILES arrays into a session because I want to
move the files later to a specific directory (ie after I get a result_id
from a sql insert). No problem putting the variables in a session but I
can't move $_SESSION['userfile']['tmp_name'] anymore.
I fell over that as well, but 'tmp_name' is only TeMPorary for the
request. Next page its gone. You'll either have to copy teh file
somewhere ore really read the file content into a session variable.
$_SESSION['userfile']['error'] is 0 so I don't really see what could be
the problem....
If you look on the server, its just gone. I assume because its
temporary.

HTH, Jochen

Anybody can help?

Trogie


--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #3

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

Similar topics

0
by: Eric Haskins | last post by:
Ok I am trying to get these loops figured out I have 10 files being uploaded- $_FILES I need to run str_replace on all 10 to eliminate any oddities " ","%20" to clean up the filenames before...
0
by: mrbog | last post by:
All I did was recompile my PHP 4.3.4 with the included GD and now my $_FILES is perpetually empty. My php app is identical, I haven't changed it at all since recompiling. I tried recompiling...
1
by: Bob Bedford | last post by:
I've a function asking for a $_FILES argument: function insertarticle($particle,......,$pUserID,$pOptions,$files){ in this function I do add the record and then save the files in a subdirectory...
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: Iced Milk Tea | last post by:
I am trying to program a upload system. The following code work very fine, $file_name = $_FILES; $size = filesize($file_name); $type = mime_content_type($file_name); However, when I change...
8
by: mpar612 | last post by:
Hello, I am a newbie to PHP, MySQL. I am trying to create a basic file upload form. I want to get that working and then I want to integrate that into a form that will rename the file and save...
3
by: skulkrinbait | last post by:
I've a HTML form that allows a user to specify the location to upload a file from: <p><label for = 'file'>Upload Graphics : <input type='file' name='imagefile' /></label></p> I then want to...
5
by: Karl | last post by:
Hello again. I have a form for posting news articles. Form one is the "register" form. Then I go to the preview form were I can select edit or accept If I select edit, I got the "edit form"...
3
Markus
by: Markus | last post by:
Ok, so i'm doing the multiple file upload thingymabob! I'm just playing around really... When i try to check the file type i simply get Array(). foreach ($_FILES as $_key => $_value) {...
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: 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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.