close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Using Upload

Thread began 8/07/2014 1:07 pm by randyrie405335 | Last modified 8/08/2014 12:45 pm by Jason Byrnes | 3346 views | 9 replies |

randyrie405335

Using Upload

How do I enter the file's name located by browsing into a MySQL database's field named "Filename"? I can get the file to upload but the file's name itself is not entered. Example: browsing locates /myfolder/my_file.pdf and the form successfully uploads the file to the myfolder directory but "my_file.pdf" filename is not entered from the form's file field "FileName" into the dB table's field "FileName" via the insert server behavior on the form.

What are the steps I need to take using the "File Manipulation: Upload Wizard" form to make this happen?

Sign in to reply to this post

Jason ByrnesWebAssist

When you use the upload file server behaviors, a new binding group is greated in the bindings panel:
WA Uploaded File (File Field name)

where File Field name is the name of the file field.

this binding group contains the Server File Name biding which contains the name of the uplaoded file.

you need to use the Data Assist insert record behavior to insert the new record, and bind the file name column to the Server File Name binding.

see this tutorial for details:
http://www.webassist.com/tutorials/Add-file-fields-to-Data-Bridge-insert-update-pages

Sign in to reply to this post

randyrie405335

Thanks Jason... your suggestions and the guide helped me to get this to work.

One other nag... how do I limit the filetype (extension) that can be uploaded i.e., I want to allow only PDF files to be uploaded and no other extensions?

The form works PERFECTLY on localhost. However, I've posted the webpage and uploaded the webassist folder to the production server but I'm surprised to get back a 500 error. I've checked the connection script (OK), checked for PHP errors in Dreamweaver (none found), checked the form for bad HTML or script errors (all OK) but still get a blank page. Permissions for the webassist folder and the upload webpage on the production server are OK. The MySQL database fields match the form's fields. So as far as I can find, all's well with the code and the build.

Didn't have this problem with two other websites I've built using Data Bridge so I'm sure I'm missing something obvious. Any ideas what other obvious areas I might check? (I'm including the page code in the Private Message.)

Sign in to reply to this post

Jason ByrnesWebAssist

To limit the file types, use Server Validation. Select the File Extension validation type.

For the 500 error, add the following code at line 1 to turn on error reporting, this should return the actual error:

<?php
error_reporting(E_ALL);
ini_set('display_errors','on');
?>



once we know the real error, we can troubleshoot.

NOTE: in the future, pleases don't paste the page code in your message, instead, attach the php file.

Sign in to reply to this post

randyrie405335

The error is:

Parse error: syntax error, unexpected '[' in /var/www/html/webassist/file_manipulation/helperphp.php on line 74

Sign in to reply to this post

Jason ByrnesWebAssist

heres an updated version of the webassist/file_manipulation/helperphp.php file to correct the problem, this will be fixed in the next update.

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

randyrie405335

Replaced the helper.php file and am now getting this error:

Notice: Undefined index: WA_UploadResult1 in /var/www/html/seminars_spkrnominate_incl.php on line 13 Warning: move_uploaded_file(/var/www/html/078c7b66405d3292cc28d38d80fd3903_tmp.pdf): failed to open stream: Permission denied in /var/www/html/webassist/file_manipulation/helperphp.php on line 110 Warning: move_uploaded_file(): Unable to move '/tmp/phpeIrugI' to '/var/www/html/078c7b66405d3292cc28d38d80fd3903_tmp.pdf' in /var/www/html/webassist/file_manipulation/helperphp.php on line 110 Warning: copy(/var/www/html/078c7b66405d3292cc28d38d80fd3903_tmp.pdf): failed to open stream: No such file or directory in /var/www/html/webassist/file_manipulation/helperphp.php on line 112

With all the attempts to correct the first error, did I screw something up in my upload configuration?

Sign in to reply to this post

Jason ByrnesWebAssist

for the first error, I need a copy of the seminars_spkrnominate_incl.php page.

the second error means that the permissions on the upload folder are not allowing write access, you need to edit the upload folder permissions to allow write access.

Sign in to reply to this post

randyrie405335

OK. I'll check permissions.

Sign in to reply to this post

Jason ByrnesWebAssist

in the upload file server behavior, you have set the upload folder to use the Server File Name binding, you need to select the upload folder.

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