close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

File Uploaded but DB not

Thread began 10/25/2009 2:18 pm by Daryl | Last modified 10/26/2009 5:01 pm by Jason Byrnes | 1772 views | 10 replies |

DarylBeta Tester

File Uploaded but DB not

I have added a DFP field to a DA page and have used the document that tells you how to combine the two.

The files are being uploaded, however the file name is not being inserted into the database despite me using the little thunderbolt as is shown in the document.

After doing this I am left with the following sort of entry....

<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>

Any ideas why its not working?

Sign in to reply to this post

anonymous

Daryl,

That is the correct variable for your image name column... not sure what is going on there. Can you confirm that your insert statement or update statement comes after the DFP server behavior. I just want to rule out the possibility of the variable not getting set. Also, can you confirm that other columns are getting their respective inputs?

Best regards,

Brian

Sign in to reply to this post

DarylBeta Tester

ah...

I had to move the insert behaviour above all other behaviours otherwise I got a Headers already sent error - there is a thread about this in the DFP area.

All other table columns are populated, however the file name ones are not.

Sign in to reply to this post

Jason ByrnesWebAssist

PHP code is performed Top Down.

The Server File name Variable is created When the file uploads.

if the Upload File Behavior comes after the Insert Record behavior, then the Server File name will not have been created.


So moving the code may have alleviated the errors, but it did not fix the problem from your other thread.


lets move the insert record behavior back where it was and look into the cause of the error you where getting. can you send a copy of your k9_SaD_Insert.php page that is generating the error message so I can examine the code?

Sign in to reply to this post

DarylBeta Tester

Server behaviour moved back and file attached.

The errors are;

  Warning: Invalid argument supplied for foreach() in .../WA_DigitalFilePro/HelperPHP.php on line 80

Warning: Cannot modify header information - headers already sent by (output started at .../WA_DigitalFilePro/HelperPHP.php:80) in .../admin/k9_SaD_Insert.php on line 157  
Attached Files
k9_SaD_Insert.zip
Sign in to reply to this post

anonymous

Daryl,

The Error about not being able to modify header information is 9 out of 10 times caused by white space above your Doctype Declaration and the HTML.

Many times, an inadvertent space added after a closing a PHP tag is the cause.

While it is ok to start new PHP blocks on a line down - you need to ensure there is zero chance of an actual space behind each closing PHP block.

You could even go as far as closing one and starting the very next one right after it like this: " ?><?php "

I would go through it - clean up any spaces and then try it again.

Regards,

Brian

Sign in to reply to this post

Jason ByrnesWebAssist

Brian,

in this case the output to the page is the previous error:
Warning: Invalid argument supplied for foreach() in .../WA_DigitalFilePro/HelperPHP.php on line 80

since this is a warning, it does not stop the script from processing, so when it gets to the header function, the error is considered output and throws the header already sent error.


Daryl,

give me a few to look over the code...

Sign in to reply to this post

DarylBeta Tester

No problem Jason

Sign in to reply to this post

Jason ByrnesWebAssist

Daryl, there was some code out of order for the file upload.

I have rearranged the code in the attached copy of your file. Try this one.

Attached Files
k9_SaD_Insert.zip
Sign in to reply to this post

DarylBeta Tester

Hi Jason

That did the trick.

Was it something that I did?

Just so that I know how to correct it in the future should it happen again.

Sign in to reply to this post
loading

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...