close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Image file upload

Thread began 5/06/2019 12:35 pm by john70964 | Last modified 5/22/2019 1:54 pm by Ray Borduin | 1071 views | 9 replies |

john70964

File image upload

Hello Ray
I created a page for uploading some images. I thought I had followed the instructions on page
http://www.webassist.com/tutorials/Resizing-images-on-upload but obviously not!

The image names are not being placed in the database and the images are not being placed in the images folder.

Can you see where I am going wrong please?
Many thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

You have your file upload set to the recordset value instead of the form file field.

They are all wrong, but for instance:
'FileName' => "".($rs->getColumnVal("image10")) ."",

should be:
'FileName' => "[FileName]",

Your database update statement is only using one of the fields. You would have to update the MySQLi Update Table server behavior to add the other file upload fields. It looks like it is properly updating the imge1 field.

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

When Updating image fields with Mysqli Update Record I go to column Bindings and press the lightning bolt
I have a choice of Folders and files which can be selected.

Which should be selected for the File Fields?
Many thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

The uploaded file "Server File Name" for each upload should be used to update the database.

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Thanks Ray,
Maybe I did not quite understand the above answer.

I changed Upload File (Image1) to include serverFileName
I then received these errors when the page was run.
Notice: Undefined index: WA_UploadResult1 in C:\xampp\htdocs\boatsforsalenow_mysqli2\BoatAds180\boat_insert_images.php on line 48
Notice: Undefined index: WA_UploadResult1 in C:\xampp\htdocs\boatsforsalenow_mysqli2\BoatAds180\boat_insert_images.php on line 58
Notice: Undefined index: WA_UploadResult1 in C:\xampp\htdocs\boatsforsalenow_mysqli2\BoatAds180\boat_insert_images.php on line 68
Notice: Undefined index: Image2 in C:\xampp\htdocs\boatsforsalenow_mysqli2\webassist\file_manipulation\helperphp.php on line 72

Pls see serverFileName.jpg

I then changed this back to [FileName] and the errors were removed but a new one appeared
Notice: Undefined index: Image2 in C:\xampp\htdocs\boatsforsalenow_mysqli2\webassist\file_manipulation\helperphp.php on line 72

I also noticed that in the database some of the field entries were incorrect
image1_900 remains as its default field name no_image.jpg
Image1 shows the correct name
image1_thumb remains as its default field name no_image.jpg
image1_250 shows the name cai3367b but has lost the .jpg part
image2 shows the correct name
image3 shows the correct name
image4 remains as its default field name no_image.jpg
image5 shows the correct name
I also tested on the remote server with the same results

Sign in to reply to this post

Ray BorduinWebAssist

You should not be using the file upload bindings in the file upload server behavior. I was referring to the bindings in Update Database server behavior.

Resized images should be named like: [FileName]_200

Then your Update Table server behaviors can reference the Server File Name bindings from each upload.

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Hello Ray
I originally had only 2 File Fields per page.

On the test page I have 10
If I insert 5 images into the File Fields then 5 appear in the database.
If I insert 10 images into the File Fields then none appear.

Should I limit the File Fields per page?

Sign in to reply to this post

Ray BorduinWebAssist

It is probably the php.ini limits causing it to fail.
You may have to change the upload_max_filesize and post_max_size directives in your php.ini file to accommodate more files.

Sign in to reply to this post
Did this help? Tips are appreciated...

john70964

Hello Ray
I have a test insert a record form with three hidden fields
frontpageshow
my_class
Feature
When I update the form frontpageshow and my_class both insert 1 in the correct field.
Feature field remains empty.
I wondered if you can see why this should be?
I attach the file.
Thank you
John

Sign in to reply to this post

Ray BorduinWebAssist

You don't have a column value set for the feature column in your insert server behavior. You don't need to use a hidden form element to set a static value you can just set the value to 1 in the insert server behavior and skip the hidden form element.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...