Dynamic upload renaming
I am applying my upload script and I want to be able to tag the LastIdent value onto the front of my file name (from insert with ident extension), but I am having a hard time figuring out how to put that information in. Heres the line in particular:
RUF_renameMask = "<%=LastIdent%>##name##.##ext##"
So how would I keep the filename and extension, but put this sort of dynamic information in it?
Answer:Well unfortunately this is not possible... as you end up with the chicken and the egg problem.
As the filename will be stored in the database - the file has to be saved first, then renamed and them the latest value should be saved in the database.
But until you save it in the database you don't know the last ID of the record.
So maybe you should ask yourself if it is really wise to store the ID in the file name as well ...
If you just want to store another variable that it is no problem:
Then you just need to enter a valid vbscript expression like:
jobID & "##name##.##ext##"
or maybe if the JobID is coming from the QueryString:
Request.QueryString("jobID") & "##name##.##ext##"
or if you want to use other form field from the uploaded form (like a hidden field) :
UploadFormRequest("jobID") & "##name##.##ext##"
DISCLAIMER:
This is extra complimentary content which purpose is to show additional usage that is not part of the product, i.e. it suggests tips for extending the functionality of the product by the users themselves.
It is provided "as is", without warranty of any kind, express or
implied , including but not limited to the warranties of
merchantability, fitness for a particular purpose and nonfringement of
third party rights.
DMXzone does not take responsibility to
support the suggested content to be fully compatible and working as
intended and does not provide support for extended functionality which
is not included in the current release of the extension.
It is highly recommended that only more advanced developers use it.
Comments
Upload renaming Permissions
Renaming with date and time
If i want to rename the file with the current date and time what i have to do?
i tryed date(), <%= date() %>, response.write date(), and i can get this work
for the php version it seems easy
2 uploads with different names
How do I upload 2 different images with different names.
Like image1 could be: "Large+<%=(rec_getorder.Fields.Item("port_order").Value +1)%>.##ext##"
Image 2 could be: "Small+<%=(rec_getorder.Fields.Item("port_order").Value +1)%>.##ext##"
Thanks for any help.
You must me logged in to write a comment.