close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

First Time Uploading - need examples

Thread began 8/04/2010 2:02 pm by larry289409 | Last modified 8/05/2010 11:19 am by Jason Byrnes | 1265 views | 3 replies |

larry289409

First Time Uploading - need examples

All I want to do is to have a form that will have a name I want to assign to a file, and a button to click to locate the file to be uploaded and renamed.

I need to have the flv extension attached.

I have looked at the built-in help, but nothing uploads.

I need a tutorial or sample code.


Thank you.

Sign in to reply to this post

Jason ByrnesWebAssist

First, you need to create your form.

Go to Insert -> Form -> Form to add the form tag.

Go to Insert -> Form -> Text Field to add a text box. set the name of the text box to "FileName" (without the quotes)

Go to Insert -> Form -> File Field to add the file field. Set the name to "selectedFile" (no quotes again)

Go to Insert -> Form -> Button to insert the submit button.

Once the forn is created, add the upload file server behavior. Go to Insert -> WebAssist -> File Manipulation -> Upload.

Set the trigger to any form post.

Select the selectedFile file field.

On the second page, click the lightning bolt next to file name and select the FileName form field.

when filling out the form, type the name of the file in the file name form field, do not include the extension.

The extension will depend on the file that is uploaded, if the uploaded file is a jpg, the extension will be jpg, if it is an flv, the extension will be flv.

Sign in to reply to this post

larry289409

Thanks for the instructions, but...

I did all that, but nothing ever is uploaded. I look in the destination folder, but it's still empty.

Here's my code:



<?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' => "video/",
'FileName' => "".((isset($_POST["FileName"]))?$_POST["FileName"]:"") ."",
'DefaultFileName' => "",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "selectedFile", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Upload a Video</title>
</head>
<body>
<form action="videoupload.php" method="post" name="Video_upload" target="_self">
<table width="700" border="0">
<tr>
<td>Property Number</td>
<td><input name="FileName" type="text" size="20"></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>File to Upload</td>
<td><input name="selectedFile" type="file"> </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<input name="" type="submit"></form>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

for a file to upload, the forms encoding type must be set to multipart/form-data.
change the form tag:
<form action="videoupload.php" method="post" name="Video_upload" target="_self">

to:
<form action="videoupload.php" method="post" name="Video_upload" target="_self" enctype="multipart/form-data" >

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