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

Upload, Default HELP

Thread began 4/07/2013 2:54 pm by Cologne | Last modified 4/09/2013 10:29 am by Jason Byrnes | 476 views | 4 replies |

Cologne

Upload, Default HELP

Hi,
I nearly go crazy, or its too late.
When people register, they upload an image. (random-name).
In the backend they can change the image.
So, I set a hidden field (current-image) and store the current-image-name in it.
In the upload behavior I choose overwrite.
For File name I choose current-image from the hidden field.
And for default, too.
But this does not work.
It puts another .jpg at the end.
What am I doing wrong. I just want to keep the image name and let people update their profile, with or without chnaging the image.
Help!
Denis

Sign in to reply to this post

Jason ByrnesWebAssist

The File Name setting should not include the file extension, this will be taken from the uploaded file, or if the form is being converted for images, from the selected format settings.

in this case it looks like you are converting web images to .jpg

in the file name, setting use str_replace to strip the .jpg extension from the value of the hidden element:

change:

php:
'FileName' => "".((isset($_POST["currentImage"]))?$_POST["currentImage"]:"")  ."",



to:

php:
'FileName' => "".((isset($_POST["currentImage"]))?str_replace(".jpg","",$_POST["currentImage"]):"")  ."",
Sign in to reply to this post

Cologne

Hi Jason,
this does the trick.
I thought myself I could use it with the 2 fields, the simple file name and the server filename, but yours is better :-)
Thanks a lot!
Denis

ps. niw I dont need the 3 delete behaviors :-)

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working

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