Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

session.upload_progress with multiple file uploads

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

session.upload_progress with multiple file uploads

Postby hyphrend » Mon Dec 03, 2012 2:45 pm

I posted this question on stack overflow but got no answers to my question and so I wanted to ask here where it may get a bit more views and help.

I'm having an issue with using the session.upload_progress method to create individual upload progress bars for each upload. For my multiple file uploads I'm using an array as the name and giving the user the ability to have multiple file inputs in one input or multiple file inputs.

Example:
Code: Select all
<input type='file' name='files[]' multiple='true'/>
<input type='file' name='files[]' multiple='true'/>


The upload works fine but when I send an AJAX request to another file to get the upload progress it only sends back the overall progress and the progress of the first file being uploaded. The overall progress shows that there are a lot more files being uploaded and yet only one is shown in the upload progress array.

The file that sends back the upload progress looks like

Code: Select all
header('Content-type: application/json');
session_start();

$key = ini_get("session.upload_progress.prefix") . "imageform";

if (!empty($_SESSION[$key])) {
    echo json_encode($_SESSION[$key]);
    exit;
}
exit;


So when I get this back I'm only getting the overall progress and the first file in the upload queue. I did notice though that the name of the input field given in the array for that file is "files[]". I'm wondering if it must have unique input name fields in order to differentiate between the separate files or not.

I have searched the web for solutions to this but the only implementations of the session.upload_progress I have found have different names for each file input and so I haven't been able to find any that explain how to do it this way or if it's even possible to get all the individual files this way.

Thanks in advance for any help or direction.
hyphrend
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Dec 03, 2012 2:39 pm

Re: session.upload_progress with multiple file uploads

Postby hyphrend » Wed Dec 05, 2012 5:02 pm

Quite a few views but no replies yet. Does no one know the answer to this one?

If not can anyone point me to somewhere that might be able to answer this question?
hyphrend
New php-forum User
New php-forum User
 
Posts: 2
Joined: Mon Dec 03, 2012 2:39 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.