Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Rename Uploaded Files

Posted 05 Jan 2004 07:41:28
1
has voted
05 Jan 2004 07:41:28 David Forshaw posted:
Hi

I want to be able to rename the uploaded files.

When I select the rename extension and I change the default ("pm_##name##.##ext##" by selecting the lightning bolt icon and selecting a recordset option I get errors.

If this is the code how can i change this so that I can rename the files to a recordset value:

<%
' *** Rename Uploaded Files 1.7.0
If (CStr(Request.QueryString("GP_upload") <> "" Then
Dim REUF_path, REUF_nameConflict, REUF_renameMask
REUF_path = ""
REUF_nameConflict = "uniq"
REUF_renameMask = "pm_##name##.##ext##"
RenameUploadedFiles REUF_path,REUF_nameConflict,REUF_renameMask
end if
%>

I want the files to be renamed to the propID and the userID eg.(rsImageInsert.Fields.Item("propID".Value)

Any ideas
David

Replies

Replied 07 Jan 2004 13:55:38
07 Jan 2004 13:55:38 Patrick Woldberg replied:
Something like:

REUF_renameMask = "pm_" & rsImageInsert.Fields.Item("propID".Value & rsImageInsert.Fields.Item("userID".Value & ".##ext##"

--------------------------------------------------
Patrick Woldberg
Web Developer at Dynamic Zones
Manager at DMXzone.com
--------------------------------------------------
Replied 09 Jan 2004 02:25:48
09 Jan 2004 02:25:48 David Forshaw replied:
Hi Thanks for the response.

i tried your code and changed it alittle to this:
REUF_renameMask = "pm_" & rsSeller.Fields.Item("userID".Value & ".##ext##"

rsSeller is the name of the recordset.

But now I get an error saying this:
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'rsSeller'
/propertyMarket/sellingForm_new.asp, line 71

Any ideas?
Replied 09 Jan 2004 02:32:34
09 Jan 2004 02:32:34 David Forshaw replied:
And why does the fie get renamed but when the smart image proccesor is applied and thumbnails are created the thumbs do not get renamed.

Is there any way of doing this?
Replied 09 Dec 2004 21:27:20
09 Dec 2004 21:27:20 jose antonio javiadas replied:
how do you resolved this?? i want to rename the file i upload to the id that correspond to that record and .jpg
any idea?

Reply to this topic