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

Can't get file upload to work

Thread began 8/10/2010 1:55 pm by Kev Hegan | Last modified 8/13/2010 4:35 pm by Jason Byrnes | 904 views | 5 replies |

Kev Hegan

Can't get file upload to work

Hi,

I have used Data Assist to successfully create a searchable publications database for a client, with a little help from the forum, so I am very pleased to say I managed this with little knowledge of databases and mySQL thanks to your product :)

Now I have purchased Universal Email for the File Upload features because the client requires the ability to add files to their database.

So, I have copied the insert page and followed the instructions in "Adding Digital File Pro to Data Assist Insert and Update Pages". I found them pretty straightforward but unfortunately the resulting page doesn't seem to work. I have had to add two new fields to the database but I updated the recordset in the server behaviors so as far as I can tell the code looks ok. The page updates the fields it used to, but nothing is added to the new fields (RecordType and PresentedAt). I replaced the URL field (where previously a web address could be added) with the file upload stuff. I used the same ID as described in the documentation. Nothing is added to this field and no file is copied to the folder I specified.

It's probably a simple mistake, would someone have a quick look at my code and see if its obvious? I've attached a zipped version of the file.

I'm hoping that the filename will be added to the URL field. This is already set up to display as a link on my details page. Am I correct in thinking this is how it will work by default?

Thanks for any help you can give. I read with relief about the decision to carry on with forum support. We are doing everything on a tight budget and nearly $50 for a support ticket is out of the question.

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

Jason ByrnesWebAssist

to trouble shoot the issue, follow these steps:

1) Add the following code at line 1:

php:
</php

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




2) find the following line:

php:
$WA_redirectURL = "journals_Results.php";



and change it to:

php:
$WA_redirectURL = "";



On the bindings panel, expand the WA Global status group and drag the debug info binding to the body of the page.


report back the results after testing the upload again.

Sign in to reply to this post

Kev Hegan

Hi Jason,

Thanks for your response. Here are the results with the debug code in the page:

Status object: WA_UploadResult1
statusCode : -1
errorMessage :
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : -1
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName :
fileExtension :
serverFileName :
serverSimpleFileName :
serverDirectory :
contentType :
fileSize : -1
imageWidth : -1
imageHeight : -1

Sign in to reply to this post

Jason ByrnesWebAssist

is this from before or after trying to upload file? I would like to see the results from after trying to upload the file.


One issue i see is that the file you sent me is named "journals_Insert_File.php", but the forms action is set to post to "journals_Insert.php"

php:
<form  action="journals_Insert.php" method="post" enctype="multipart/form-data" name="WADAInsertForm" id="WADAInsertForm">




try changing that to:

php:
<form  action="journals_Insert_File.php" method="post" enctype="multipart/form-data" name="WADAInsertForm" id="WADAInsertForm">
Sign in to reply to this post

Kev Hegan

Doh! I didn't think of that... I missed the obvious! Thanks so much, it seems to be working now :)

One remaining question:

The filename is entered in the database, but I have set up the file upload wizard to put the files in a 'files' folder. Is there an option to put a relative link (files/myfile.doc)? There are several options in the wizard but I'm not sure what they do (Field Name, Temp Path, Simple File Name and so on). I've found the getting started documentation, is there a detailed guide?

Thanks, Jason, your help is much appreciated.

Sign in to reply to this post

Jason ByrnesWebAssist

in the insert record behavior, you can add "files/" in front of the code for the server file name binding:

php:
files/<?php echo $WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"]; ?>
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...