php - input type="file" - temp files deleted with post-redirect-get -


i have form allow user upload files. changed post processing post-redirect-get since user enters other information well. noticed global $_file visible redirect.php lost after redirecting input form. attempted save $_file array, appears temp files removed post-redirect-get. there way tell server preserve temp files when leaving redirect.php can process them when see fit? in advance.

user form:

<input type="file" name="file[]" id="userfiles" size='1px' multiple onchange="makefilelist();" /> 

redirect file:

if (isset($_files)){     $_session['post-files'] = $_files; } header("location: /back/to/input/form.php"); 

you might able pass encoded copy of file(s) session.

something like...

$tempimages = array();  foreach($_files $file) {     $tempimages[] = base64_encode(file_get_contents($file['tmp_name'])); }  $_session['post-files'] = serialize($tempimages); 

Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -