Pure ASP Upload 3 Support Product Page

Doesn't need answer

Server.MapPath() error 'ASP 0174 : 80004005'

Asked 27 Aug 2012 09:14:05
1
has this question
27 Aug 2012 09:14:05 Dave King posted:
Pure ASP Upload 3 has been working on my (shared hosting) server for a couple of years now without any problems. It's just stopped working though with the above error. The error suggests that the problem is caused by incSIP2Class.asp, line 520 - An invalid '/' or '\' was found in the Path parameter for the MapPath method. The line at 520 reads:


If InStr(newFilename, ":\") = 0 Then newFilename = Server.MapPath(newFilename)



I suspect that my hosting company has installed a server patch and this may have caused the issue. Any help or advice would be much appreciated. Thanks!

Replies

Replied 27 Aug 2012 10:08:15
27 Aug 2012 10:08:15 Teodor Kuduschiev replied:
Hello,

Can you please paste the PAU3 code here?
Replied 27 Aug 2012 10:34:39
27 Aug 2012 10:34:39 Dave King replied:
Edited by admin.
Replied 27 Aug 2012 10:37:22
27 Aug 2012 10:37:22 Teodor Kuduschiev replied:
Sorry, maybe i was not clear enough - we need the code that PAU3 generates on your upload page.
Replied 27 Aug 2012 10:40:10
27 Aug 2012 10:40:10 Dave King replied:
Server.MapPath() error 'ASP 0174 : 80004005'

Invalid Path Character(s)

\\NAS37ENT\DOMAINS\U\URMSTON.NET\USER\HTDOCS\GALLERY\../ScriptLibrary/incSIP2Class.asp, line 520

An invalid '/' or '\' was found in the Path parameter for the MapPath method.
Replied 27 Aug 2012 10:42:16
27 Aug 2012 10:42:16 Dave King replied:
Replied 27 Aug 2012 10:48:17
27 Aug 2012 10:48:17 Teodor Kuduschiev replied:
Once again - please copy and paste the code placed by the PAU3 on this page:
gallery_upload_details.asp

You can find it opening Dreamweaver Code view.
Replied 27 Aug 2012 10:55:11
27 Aug 2012 10:55:11 Dave King replied:
Sorry, the ASP code for gallery_upload.asp follows, with the ASP code for gallery_upload_details.asp below that:


***gallery_upload.asp


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../ScriptLibrary/incSIP2Class.asp" -->
<!--#include file="../ScriptLibrary/incPU3Class.asp" -->
<!--#include file="../ScriptLibrary/incPU3Utils.asp" -->
<%
'*** Pure ASP File Upload 3.0.13
' 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 = "uniq"
pau.StoreType = "file"
pau.ProgressTemplate = "speedometer.htm"
pau.ProgressWidth = 400
pau.ProgressHeight = 200
pau.UploadFolder = """uploads"""
pau.Required = true
pau.AllowedExtensions = "GIF,JPG,JPEG,BMP,PNG" ' "images"
pau.ProcessUpload
pau.SaveAll
%>
<%
' Smart Image Processor 2.5.3
Dim Image
Set Image = New ImageProcessor
Image.ScriptFolder = "../ScriptLibrary"
Image.Component = "AspJpeg"
Image.Source = "upload"
Image.AutoOrient = false
Image.KeepMetaData = false
Image.Matte = "#FFFFFF"
Image.UploadFields = "Upload"
Image.GetFiles
While Image.HasFiles
Image.LoadFromSource
Image.Resize 550, 550, true
Image.Overwrite = false
Image.Mask = "##path####name##.jpg"
Image.SaveJPEG 90
Image.MoveNext
Wend
Set Image = Nothing
%>
<%
' Smart Image Processor 2.5.3
Dim Thumb
Set Thumb = New ImageProcessor
Thumb.ScriptFolder = "../ScriptLibrary"
Thumb.Component = "AspJpeg"
Thumb.Source = "upload"
Thumb.AutoOrient = false
Thumb.KeepMetaData = false
Thumb.Matte = "#FFFFFF"
Thumb.UploadFields = "Upload"
Thumb.GetFiles
While Thumb.HasFiles
Thumb.LoadFromSource
Thumb.Resize 100, 100, true
Thumb.Overwrite = false
Thumb.Mask = "##path##thumb_##name##.jpg"
Thumb.SaveJPEG 90
Thumb.MoveNext
Wend
Set Thumb = Nothing
If (CStr(Request.QueryString("GP_upload") <> "" Then
Response.Redirect "gallery_upload_details.asp?FileName=" & (pau.Fields("Upload".FileName)
End If
%>


*** gallery_upload_details.asp


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Connections/ConnGallery.asp" -->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME")
If (Request.QueryString <> "" Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If

' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
If (CStr(Request("MM_insert") = "form1" Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd

Set MM_editCmd = Server.CreateObject ("ADODB.Command"
MM_editCmd.ActiveConnection = MM_ConnGallery_STRING
MM_editCmd.CommandText = "INSERT INTO Gallery (GalleryCategory, GalleryCaption, GalleryAddedby, GalleryEmail, GalleryActualDate, GalleryAuth, GalleryImage) VALUES (?, ?, ?, ?, ?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 50, Request.Form("category") ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 203, 1, 1073741823, Request.Form("caption") ' adLongVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 202, 1, 100, Request.Form("addedby") ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param4", 202, 1, 50, Request.Form("email") ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param5", 202, 1, 50, Request.Form("actualdate") ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param6", 202, 1, 50, Request.Form("hiddenauth") ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param7", 202, 1, 100, Request.Form("hiddenimage") ' adVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close

' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "gallery_uploaded.asp"
If (Request.QueryString <> "" Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<%
Dim Categories
Dim Categories_numRows

Set Categories = Server.CreateObject("ADODB.Recordset"
Categories.ActiveConnection = MM_ConnGallery_STRING
Categories.Source = "SELECT * FROM categories ORDER BY categories ASC"
Categories.CursorType = 0
Categories.CursorLocation = 2
Categories.LockType = 1
Categories.Open()

Categories_numRows = 0
%>
<%
Dim jpgext
Dim newjpg
jpgext = Request.QueryString("FileName"
jpgext = Left(jpgext, InStrRev(jpgext, "." - 1)
newjpg = jpgext+".jpg"
%>
Replied 27 Aug 2012 12:50:24
27 Aug 2012 12:50:24 Teodor Kuduschiev replied:
Can you please try to change:
pau.ScriptLibrary = "../ScriptLibrary"
with pau.ScriptLibrary = "/ScriptLibrary"
Replied 27 Aug 2012 13:18:07
27 Aug 2012 13:18:07 Dave King replied:
Hi Teodor,

I made the change to the gallery_upload.asp page as requested but it still gave me an error:

Set pau = new PureUpload
pau.ScriptLibrary = "/ScriptLibrary"
pau.ConflictHandling = "uniq"


Server.MapPath() error 'ASP 0174 : 80004005'

Invalid Path Character(s)

\\NAS37ENT\DOMAINS\U\URMSTON.NET\USER\HTDOCS\GALLERY\../ScriptLibrary/incSIP2Class.asp, line 520

An invalid '/' or '\' was found in the Path parameter for the MapPath method.

I also tried makign the path absolute and received a different error. I'm not sure if this helps though:

Set pau = new PureUpload
pau.ScriptLibrary = "www.urmston.net/ScriptLibrary"
pau.ConflictHandling = "uniq"

Server.MapPath() error 'ASP 0173 : 80004005'

Invalid Path Character

\\NAS37ENT\DOMAINS\U\URMSTON.NET\USER\HTDOCS\GALLERY\../ScriptLibrary/incPU3Class.asp, line 1647

An invalid character was specified in the Path parameter for the MapPath method.

Thanks!
Replied 02 Oct 2012 12:44:01
02 Oct 2012 12:44:01 Dave King replied:
Hi Teodor,

Did you make any progress with this? Thanks!
Replied 21 Oct 2012 18:22:14
21 Oct 2012 18:22:14 Dave King replied:
Hi Teodor,

Please can you give me an update? Thanks!

Reply to this topic