close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Simple form, 1 field, pdf won't upload

Thread began 3/22/2012 7:00 pm by bjgarner241692 | Last modified 3/26/2012 8:39 am by Jason Byrnes | 3133 views | 3 replies |

bjgarner241692

Simple form, 1 field, pdf won't upload

I don't see why this simple form work?

php:
<?php require_once("../webassist/file_manipulation/helperphp.php"); ?>

<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
    
'UploadFolder' => "../AdvHTML_Upload/pdfs/",
    
'FileName' => "[FileName]",
    
'DefaultFileName' => "",
    
'ResizeType' => "0",
    
'ResizeWidth' => "0",
    
'ResizeHeight' => "0",
    
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct
("WA_UploadResult1");
if((((isset(
$_POST["Upload"]))?$_POST["Upload"]:"") != "")){
    
WA_DFP_UploadFiles("WA_UploadResult1""newpdf""0""""false"$WA_UploadResult1_Params);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form  action="ck-confirm.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
  <label>
    <input type="file" name="newpdf" id="newpdf" />
  </label>
  <label>
    <input type="submit" name="Upload" id="Upload" value="Upload" />
  </label>
</form>
</body>
</html>
Sign in to reply to this post

Jason ByrnesWebAssist

probably a dumb question, but i have to make sure:
the forms action is to post to a page named ck-confirm.php, is the name of the page the form is on?

<form action="ck-confirm.php" method="post" enctype="multipart/form-data" name="form1" id="form1">


To submit the form, are you clicking the submit button or are you hitting the keyboard enter button?

I ask because you have the trigger set to the submit button pressed, in some browsers (cough, IE, cough), the submit button is not included in the form when there is only one other element.

to help troubleshoot, turn on error reporting by adding the following code at line 1:

php:
<?php 

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



also, add the dfp debug info binding to the page. from the bindings panel, expand the WA Uploaded Files Global status and drag the debug info binding, post back the debug info and any errors that occur after trying the upload again.

Sign in to reply to this post

bjgarner241692

The page this form is on is called ck-listing.php.
It is posting to a different page.
It does post, it just does not upload.

Changed to post to the same page as the form to capture this information.

__

Status object: WA_UploadResult1
Status object: WA_UploadResult1
statusCode : 1
errorMessage :
clientFileName : blank2.pdf
fileExtension : pdf
serverFileName : blank2.pdf
serverSimpleFileName : blank2
serverDirectory : C:\EDITED\AdvHTML_Upload\pdfs\
contentType : application/pdf
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
fileSize : 34469
isImage :
imageWidth : -1
imageHeight : -1
WA_UploadResult1_1:
clientFileName : blank2.pdf
fileExtension : pdf
serverFileName : blank2.pdf
serverSimpleFileName : blank2
serverDirectory : C:\Inetpub\vhosts\impcoautomotive.com\httpdocs\AdvHTML_Upload\pdfs\
contentType : application/pdf
fileSize : 34469
imageWidth : -1
imageHeight : -1
fileWasOverwritten :
fileWasSkipped :
fileWasRenamed :
statusCode : 1

__

Sign in to reply to this post

Jason ByrnesWebAssist

Rule number 1 when working with forms:

All form Processing must occur on the forms action page


if the form is on "ck-listing.php" and the action is set to another page, in this case "ck-confirm.php":
<form action="ck-confirm.php" method="post" enctype="multipart/form-data" name="form1" id="form1">

the processing must occur on the ck-confirm.php page.

by changing the post to point to itself, you have set the form to post to the page that has the upload behavior on it, which is why the upload is successful.

if the action points to the ck-confirm.php page, the upload behavior must be on the ck-confirm.php page

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