close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

What tool or combination of tools to use to build a form with image upload?

Thread began 1/02/2014 6:35 pm by FPhu61701534 | Last modified 1/07/2014 10:14 pm by FPhu61701534 | 610 views | 18 replies |

FPhu61701534

What tool or combination of tools to use to build a form with image upload?

I would like to build a form that allows the user to upload one or more photos together with their bio data. Can this be done with DataAssist only or do I need other tools like Digital FilePro? What is the workflow?

Sign in to reply to this post

Jason ByrnesWebAssist

Data Bridge contains the functionality of Digital File pro and Data Assist. See this tutorial for details on adding file upload data bridge insert and update pages:

http://www.webassist.com/tutorials/Add-file-fields-to-Data-Bridge-insert-update-pages

Sign in to reply to this post

FPhu61701534

Another thing, after the user has uploaded the image to the database, is it possible to send a copy of the image via email on form submits?

I tried following the steps in the tutorial at the link you provided. I am lost! Do I need to create a database table since I have to use Insert Record? Is there a video on this?

Sign in to reply to this post

Jason ByrnesWebAssist

you mention that the form is going to be used to enter Bio Data, so I assumed this would be stored in a Database. It does not _have_ to be, but if you wish to use the info on other pages of the site, then yes, you would need a database table.

if you only wish to send the uploaded file and bio information through an email, then no you don't need as database. In that case it is a simple mater of creating a form, and adding the Universal Email behavior. In Universal Email there is a section to set the attachments.

if you want to send the email, and save the information to a database, you need to use the insert behavior, the upload file behavior, and the Universal Email behavior.

It's a little difficult to give specific answers, which you seam to be looking for, when the question does not include enough detail.

the topic "file upload" can fit any number of use cases.

Sign in to reply to this post

FPhu61701534

I created a very simple image upload page but it fails to work.

Sign in to reply to this post

Jason ByrnesWebAssist

the upload helper file that should be here:

webassist/file_manipulation/helperphp.php


is returning a 404 page not found error message meaning it does not exist on the server.

make sure to upload the webassist/ folder to the server.

Sign in to reply to this post

FPhu61701534

Ok. I have uploaded the webassist folder. There is no more error message. However, no image is uploaded to the designated folder. See my private message for the hosting engineer's reply.

Attached Files
image_upload.php
Sign in to reply to this post

Jason ByrnesWebAssist

One issue i see is that you have bound the fi;le name setting to the Server File name binding that is created by the upload.

this is circular logic. you cant use the server file name variable for the file name setting since the file has not yet been created on the server.

the server file is a variable created by the upload after the file has been created on the server using any renaming settings you have set. In your case, you have set the if file exists to over write the existing file, but if you had selected to rename the new one with an increment value, this would need to get added to the files name.

in the upload settings, for the file name, you should leave the default value:
[FileName]

this will use the original file name when it saved the file on the server.


to trouble the file upload, make the following changes:

1) add the following code at line 1 to turn on error reporting:

php:
<?php 

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



2) add the following before the </body> tag:

<pre><?php var_dump($_FILES); ?></pre>



3) place you cursor in the body of the page, open the bindings panel, expand the WA UPloaded Files Global Status collection, select the Debug Info binding and click the Bind button at the bottom of the binding panel to add the debug info to your page.


once these changes are made, let me know and i will test the page to see the result and determine how to proceed.

Sign in to reply to this post

FPhu61701534

I still can't find the image in the \photos\ folder. The debug results as follow:

Status object: WA_UploadResult1
statusCode : 1
errorMessage :
clientFileName : 767A4948_mobi.jpg
fileExtension : jpg
serverFileName : 767A4948_mobi_2.jpg
serverSimpleFileName : 767A4948_mobi_2
serverDirectory : \photos\
contentType : image/jpeg
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
fileSize : 646725
isImage : 1
imageWidth : 1024
imageHeight : 1024
WA_UploadResult1_1:
clientFileName : 767A4948_mobi.jpg
fileExtension : jpg
serverFileName : 767A4948_mobi_2.jpg
serverSimpleFileName : 767A4948_mobi_2
serverDirectory : \photos\
contentType : image/jpeg
fileSize : 646725
imageWidth : 1024
imageHeight : 1024
isImage : 1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed : 1
statusCode : 1

array(1) {
["txt_photoupload"]=>
array(5) {
["name"]=>
string(17) "767A4948_mobi.jpg"
["type"]=>
string(10) "image/jpeg"
["tmp_name"]=>
string(29) "C:\php\uploadtemp\php7DAD.tmp"
["error"]=>
int(0)
["size"]=>
int(646725)
}
}

Sign in to reply to this post

FPhu61701534

This is the hosting provider's reply (see private message).

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