Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple File upload and insert from single form

Thread began 2/22/2012 7:04 pm by jacob339944 | Last modified 2/23/2012 11:18 am by Jason Byrnes | 925 views | 1 replies |

jacob339944

Multiple File upload and insert from single form

I found a thread that seemed to address the same situation I just found myself in. I have a single form where I need to upload multiple files and insert them as individual records in the database. I tried this to avail. Was wondering if you could take a look and see if I messed anything up. Here is the thread: showthread.php?t=21498

It uploads and inserts the first file, but then nothing, not uploading or inserting the other four files.

It's late, I'm tired and I can't see anything that appears wrong. Thanks for your help.

Attached Files
Files_Insert_multi.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is that you have added a redirect to the insert behavior:
$WA_redirectURL = "Files_Results.php";


it inserts the first record, then redirects to the Files_Results.php page before it has a chance to insert the other records....

change:

php:
$WA_redirectURL = "Files_Results.php";



to:

php:
$WA_redirectURL = "";




then change this code:

php:
<?php 

if(sizeof($_SESSION['uploadedFiles']) > 0) {
  unset(
$_SESSION['uploadedFiles']);
  
header("Location: ".$WA_redirectURL);
}
?>



to:

php:
<?php 

if(sizeof($_SESSION['uploadedFiles']) > 0) {
  unset(
$_SESSION['uploadedFiles']);
  
header("Location: Files_Results.php");
}
?>




you cant set the redirect in the insert behavior for this, you have to set it manually in the code that unsets the session.

also, in your code, there are blank lines between code blocks, this can cause issues with the redirect happening.

see this post for details:
showthread.php?t=19285

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...