close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

File Upload issue - extra file extension on file

Thread began 3/30/2011 11:26 am by Roland Rogers | Last modified 3/30/2011 2:10 pm by Jason Byrnes | 2639 views | 7 replies |

Roland Rogers

File Upload issue - extra file extension on file

Hi,
I have UE 4.0.1 and use DW CS4. I have an upload form that works to send a file to the designated part of the server and then updates a record with details of the upload.

The problem is that the name of the file is updated correctly in the DB (file.mp4) but the actual file on the server has an extra extension appended to it! "file.mp4.mp4"

Anybody else have seen this or know how to fix it?

Much thanks!

- Roland

Sign in to reply to this post

Jason ByrnesWebAssist

please send a copy of your page so I can examine the code.

Sign in to reply to this post

Roland Rogers

Thanks Jason,

I think I fixed it by having the uploader store the file based on its file name (as I had done before), then I added a field for file extension in my database table. For the update record behavior I had the file name written based on the simple file name and the extension carries just the extension. Then I call the file using both those fields and it worked!

I saw that in a version of the Power Gallery I've been playing with.

Is this the right approach? If it can be done better I can send the file but for now it seems to work so I won't mess with it anymore!

Sign in to reply to this post

Jason ByrnesWebAssist

set the File name setting in the file upload to [FileName]


then in the insert record behavior, bind the file column to the server file name variable.

Sign in to reply to this post

Roland Rogers

Thanks Jason,

It stopped working! Must have been a fluke. Here is the code for the file uploader. The name of the File field is "VideoFile".

<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "media/videos/",
'FileName' => "".((isset($_FILES["VideoFile"]))?$_FILES["VideoFile"]["[name"]:"") ."",
'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"])){
WA_DFP_UploadFiles("WA_UploadResult1", "VideoFile", "2", "[NewFileName]_[Increment]", "false", $WA_UploadResult1_Params);
}
?>

Sign in to reply to this post

Jason ByrnesWebAssist

set the File Name to "[FileName]"

this line:
'FileName' => "".((isset($_FILES["VideoFile"]))?$_FILES["VideoFile"]["[name"]:"") ."",

should be:
'FileName' => "[FileName]",

Sign in to reply to this post

Roland Rogers

awesome. That is how I remembered it working in other installations but this was not an option through using the wizard.

I kept selecting the name of the field and it resulted in hte previous code.

All is now well with my system!!

Thanks so much!

Sign in to reply to this post

Jason ByrnesWebAssist

when you first open the wizard, this is the default value that the file name will be set to, you dont need to change it. You ran into the problem because you changed it.

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