close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Transferring image through session to form

Thread began 12/09/2009 5:29 pm by deafboyz_audio386924 | Last modified 12/11/2009 8:16 pm by Jimmy Wu | 827 views | 3 replies |

deafboyz_audio386924

Transferring image through session to form

Hello,
I have an upload form with 4 upload slots in DFP2. What i want to do is upload the files(actually upload them, not just to a temp location) then have a thumbnail of the first image appear on a form in the next page.

On this next page the user will enter a caption/ info about the pic and then click 'finalize upload' to insert the data into the DB about the pic.

This would then go to the next form with the next thumbnail if applicable.

I have done a lil research and figured I can do this with sessions but am not sure how to go about doing it. I do know that i want the pictures to still remain on the server for viewing even if the user doesnt fill out the form(s), that way i maximize my content.

I am learning php and DB management currently but have a hard time understanding it so PLEASE treat me like i know nothing. thank you

Sign in to reply to this post

Jimmy Wu

You can get the file name that is stored by dragging and dropping the value from the bindings panel after applying the upload behavior. Then you can store the values in the session variables. Here is a tutorial on how to set up session variables:
phpsessions.php

Sign in to reply to this post

deafboyz_audio386924

ok is that the client file name the server file name or the simple server file name?...
so far following that tutorial i have gotten

session_start();
$_SESSION['trueUpload_Browse']=?????


do i take the value from the bindings panel and put it where the question marks are??? if so how do i call to it on the form???

no matter what filename i try i get a undefined index error.... which makes sense b/c the session hasnt been started as the upload has not been performed, i need some explanation to get this done.

you have to remember that we are novices... that why we buy web assist. now you are a pro mr jimmy wu, so please... explain so that us novices can understand, and i do mean explain it to satisfy a novice's definition of a novice, not a pro's definition if you know what i mean. thank you :)

Sign in to reply to this post

Jimmy Wu

When you drag and drop the value, it puts in code for displaying it using php. The part you are interested in storing is the actual value, which looks like this:
$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"];

To get around the error you are getting, you would want to use an if statement to check if the upload has been successful before storing the information:
$WA_DFP_UploadStatus["WA_UploadResult1"]["statusCode"];

If the upload hasn't been performed or errors that value will be -1. If the upload is successful the value will be 1 (true).

In the if statement that is where you will set the session variables.

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