Pure ASP Upload Add On Pack Support Product Page

Solved

Rename does not work

Reported 21 Apr 2011 03:06:49
2
have this problem
21 Apr 2011 03:06:49 Jeff K posted:
Using DW CS5, ASP File Upload 3.0.17 and Rename uploaded Files 1.8.1 in a new document.

Files upload fine, but no matter what I do I cannot get uploaded files to rename.

Here's the code where I try to rename the file using the default values provided by the extension (if I can get this to work, I'll put my own values in there).

Help:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../ScriptLibrary/incPU3Class.asp" -->
<!--#include file="../ScriptLibrary/incPU3Utils.asp" -->
<!--#include file="../ScriptLibrary/incPUAddOn.asp" -->
<
%'*** Pure ASP File Upload 3.0.17
' Process form form1
Dim pau, DMX_uploadAction, UploadRequest, UploadQueryString, pau_thePath, pau_nameConflict, pau_saveWidth, pau_saveHeight
Set pau = new PureUpload
pau.ScriptLibrary = "../ScriptLibrary"
pau.ConflictHandling = "over"
pau.StoreType = "file"
pau.UploadFolder = """../logos"""
pau.AllowedExtensions = "jpg" ' "all"
pau.MaxFileSize = 100
pau.ProcessUpload
pau.SaveAll
if pau.Done then Response.Redirect "logo-upload2.asp"
%>
<
%' *** Rename Uploaded Files 1.8.1
If (CStr(Request.QueryString("GP_upload")) <> "") Then
  Dim REUF_renameMask
  REUF_renameMask = "myFile_##name##.##ext##"
  RenameUploadedFiles pau_thePath, pau_nameConflict, REUF_renameMask
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript"><%=pau.generateScriptCode()%></script>
<script src="../ScriptLibrary/incPU3.js" type="text/javascript"></script>
</head>

<body>
<form action="<%=DMX_uploadAction%>" method="post" enctype="multipart/form-data" name="form1" id="form1" onSubmit="<%=pau.submitCode()%>;return document.MM_returnValue">
  <p>
    <label for="FileName">FileName</label>
    <input name="FileName" type="file" id="FileName" onChange="<%=pau.validateCode()%>;return document.MM_returnValue" />
  </p>
  <p>Submit
    <input type="submit" name="Submit" id="Submit" value="Submit" />
  </p>
</form>
</body>
</html>



Jeff

Replies

Replied 21 Apr 2011 03:10:34
21 Apr 2011 03:10:34 Jeff K replied:
I forgot to mention my dev environment is Windows 7 and I tried this with Chrome and IE--same problem.
Replied 26 Apr 2011 10:13:38
26 Apr 2011 10:13:38 Miroslav Zografski replied:
Hello Jeff,

Please, try following:

Remove the redirection from the PAU and then try again to upload a file.

Regards,
Replied 26 Apr 2011 19:10:20
26 Apr 2011 19:10:20 Jeff K replied:
Thanks Miroslav. That worked great. So, if I do want to use a redirect--do I need to hand-code it?
Replied 27 Apr 2011 13:38:05
27 Apr 2011 13:38:05 Miroslav Zografski replied:
Hello Jeff,

Use a Link for your clients to click after upload.

Regards,

Reply to this topic