close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Image Upload Naming

Thread began 4/27/2012 8:08 am by Airfox | Last modified 4/27/2012 2:19 pm by Jason Byrnes | 512 views | 3 replies |

Airfox

Image Upload Naming

I am working on a real estate system.
I'm needing uploaded images to follow an incremental naming system of propertyID_imagenumber.jpg

So, for its propertyID 51 I would hope to get:

51_1.jpg
51_2.jpg
51_3.jpg

What I'm getting, although amusing, is not what I had in mind:

51_[Increment].jpg

In the file name box on the wizzard I have:
<?php echo ((isset($_POST["propertyID"]))?$_POST["propertyID"]:""); ?>_[Increment]

Which gives me:
'FileName' => "".((isset($_POST["propertyID"]))?$_POST["propertyID"]:"") ."_[Increment]",

What am I doing wrong please?

Sign in to reply to this post

Jason ByrnesWebAssist

the File Name setting wont take the [Increment] Command, you can only use that in the first page in the If file exists section.


in the If file exists section, set it to rename the new file using the default [FileName]_[Increment] setting.

in the second step, only use the property ID form element binding, with out adding the [Increment]:
'FileName' => "".((isset($_POST["propertyID"]))?$_POST["propertyID"]:"") ."",

This wont be 100% what you are after, the first image will be named:
51.jpg

but further images will be named:
51_1.jpg
51_2.jpg
51_3.jpg

Sign in to reply to this post

Airfox

Almost...

The first file originally called P1010655 gets renamed 51.jpg.

Subsequent files get named:
P1010656_1.jpg
P1010657_1.jpg
P1010658_1.jpg

I guess I should give up on file renaming, its not going to give the results I was hoping for.
I would be better off finding a way of inserting the original file name and propertyID into a database, once the upload is complete and let the database worry about file names.
Is there an easy way to call the file name after the upload?

Sign in to reply to this post

Jason ByrnesWebAssist

  Is there an easy way to call the file name after the upload?  




the file upload behavior creates a binding group on the bindings panel called WA Uploaded Files (File Field Name) this binding group contains a binding called "Server File Name that is the name of the uploaded file.

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