View Single Post
  #1 (permalink)  
Old November 27th, 2005, 10:51 PM
juergreh juergreh is offline
Registered User
Join Date: Jan 2005
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default File upload at a later point of time

hey there

anybody knows a solution to this.
i have a form in flash at in various screens i have the option to attach a file. so i send the user to a popup where he selects a file and then i store the files as shown below in a session variables:
$_SESSION['tmp_name'] = $HTTP_POST_FILES["filename"]['tmp_name'];
$_SESSION['name'] = $HTTP_POST_FILES["filename"]['name']

after that the user returns to the flash form. at the end of the form i want to upload all the files. so i acces the session variables and paste their values into my uplaod script.

$tmp_name = $_SESSION['tmp_name'];
$name = $_SESSION['name'];

$filename = basename($name);

$filePath = "../files".$filename ;

if(!move_uploaded_file($tmp_name, $filePath))
    die('Cant copy '.$name.' to '.$filename);

exactly the same script works on immediate upload but not at a later point of time. does anybody know why? and if there is a solution to this.


Reply With Quote