Replies Back to Article

Give The File a Static Name

I cant get this to work at all!
April 11, 2001 by WilliamHill WilliamHill
If anyone thinks they can get this to work please let me know, It just continues to use the same old name, and not the one I specify, there are no errors or anything, well pissed off

Williamchill@hotmail.com
"dynamic file name"
April 24, 2001 by Gary Taylor

I was able to get the above code to work by using:
UploadRequest.Item(GP_curKey).Item("FileName") = "image.jpg"

However, I'd like the image name to be the value of one of the other fields I'm submitting, like:
UploadRequest.Item(GP_curKey).Item("FileName") = LastName & ".jpg" where LastName is a form field name.

How can I accomplish this?

RE: Hmm
April 24, 2001 by Leon Radley

I think it was

lastname = uploadrequest"thefield"

 

File Type
September 3, 2001 by j doyle
Okay...I know you guys are working on a new version of this which may fix my problem, but in order to give the file a dynamic name now, how do I find the file type within your script?  So that I can name it varMyName & "." and varFileType for example?
my code looks different?
April 14, 2003 by Alex White

The variable GP_CurFileName doesn't exist at the moment when I look at the source code for PureASPupload installed into my ASP page...

The actual line marked in red in the "solution" above is as follows:

GP_strm2.SaveToFile Trim(Server.mappath(GP_curPath))& "\" & UploadRequest.Item(GP_curKey).Item("FileName"),2

 

So what should I do? replace the UploadRequest.Item(GP_curKey).Item("FileName") with the filename that I want to use?

 

Cheers