Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 27th, 2005, 10:51 PM
Registered User
 
Join Date: Jan 2005
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.

cheers
J






Similar Threads
Thread Thread Starter Forum Replies Last Post
File Upload hariprasad.nayak Generics 1 July 3rd, 2007 02:03 AM
Filter File Types in ASP.NET File Upload ramuis78 ASP.NET 2.0 Basics 2 May 31st, 2007 10:50 AM
File Upload temmyabudu Classic ASP Components 2 December 15th, 2005 02:40 PM
Whole Folder upload(Multi file Upload) ramasamy_rams XML 1 September 9th, 2005 12:43 PM
JSP file upload and delete file pandjie JSP Basics 0 January 29th, 2005 10:49 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.