0

I have managed to get the jQuery file upload (basic plus UI) to successfully upload to custom folders by posting the values using hidden inputs from the form on upload.php

<input type="hidden" name="referrer" id="referrer" value="12345">
<input type="hidden" name="transaction" id="transaction" value="54321">

These values are then retrieved in index.php and used to create global variables

$GLOBALS['referrer'] = $_POST['referrer'];
$GLOBALS['transaction'] = $_POST['transaction'];

Which are then used in uploadHandler.php to create custom directories to upload the image to

'upload_dir' => '../../uploads/'.$GLOBALS['referrer'].'/'.$GLOBALS['transaction'].'/',
'upload_url' => '../../uploads/'.$GLOBALS['referrer'].'/'.$GLOBALS['transaction'].'/',

For uploading this works great but when I try to delete a file using the delete button on upload.php I get these errors

Undefined index: referrer in /home/tatty27/public_html/disender/server/php/index.php
Undefined index: transaction in /home/tatty27/public_html/disender/server/php/index.php

I don't get this error if I use sessions for storing the values instead of variables but I'm concerned that if an upload takes a very long time session will have timed out. Some of our users have very big files (1GB plus) to upload and very poor internet connections hence the reason why I'm using this plugin.

Failing that I am worrying about nothing, will the session stay alive whilst the file is uploading or if they drop connection for a few minutes?

tatty27
  • 1,525
  • 4
  • 32
  • 67

0 Answers0