Author |
Topic |
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 07 April 2013 : 16:56:43
|
I've got this mod in use in my forums and it works well
However I need to use it in a slightly different way for part of our forum so thought it would be a nice simple idea to duplicate the files and change their names slightly to keep the original files as they were, and then to have the second renamed set which I can then customise for the new purpose - it should be easy enough I thought.
The problem is when a link is clicked to bring up the renamed 'pop_upload_new.asp' - it displays correctly. However when the form entry is then sent to the renamed 'outputFile.asp' it results in a HTTP500 error.
All three files in the mod have been renamed as such:
pop_upload_new.asp to pop_upload_new_ads.asp outputFile.asp to outputFile_ads.asp upload.asp to upload_ads.asp
There was one reference to the outputFile.asp file in the pop_upload_new_ads.asp file which I have changed to outputFile_ads.asp
There was one reference to uploads.asp in outputFile_ads.asp which I changed to uploads_ads.asp
and one reference to pop_upload_new.asp in outputFile_ads.asp which I have changed to pop_upload_new_ads.asp
All in all I cannot see why it should not work and yet if I use the files in their original names it does work, so it has to be something connected to the file name change, doesn't it?
Link to the original mod: http://www.snitzbitz.com/mods/details.asp?Version=All&mid=67
Help !! |
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 07 April 2013 : 18:59:56
|
You missed the include.
Line 1 of outputfile.asp
|
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 08 April 2013 : 02:20:15
|
Nope, got that one:
<!--#include file="upload_ads.asp"--> <!--#INCLUDE FILE="config.asp" --> <%
It's got me baffled as it should have been so easy :) |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 08 April 2013 : 07:09:27
|
Then it has to be a permissions issue. Make sure the additional area has write permissions set for IUSR, IIS_IUSRS, & NETWORK SERVICE. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 08 April 2013 : 17:16:57
|
I've double checked all the permissions for the 'uploaded' folder, it is the same folder that I am using to upload to with the first (original) lot of files
I've just run the files through Firefox and it resulted in this error:
Microsoft VBScript runtime error '800a004c'
Path not found
/forum/outputFile_ads.asp, line 57
Lines 55,56 & 57 read in outputFile_ads.asp:
..which are identical to the original outputFile.asp file and using the original files it works
|
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 08 April 2013 : 20:44:31
|
Between lines 56 & 57, insert this, let's see what the values show:
Response.Write pathEnd & "=pathEnd<br />" & SUBFOLDER & "=subfolder<br />" & filename & "=filename" |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 09 April 2013 : 02:25:56
|
It returns:
56=pathEnd uploaded/Dave=subfolder 20134972118_wotno.jpg=filename
Microsoft VBScript runtime error '800a004c'
Path not found
/forum/outputFile_ads.asp, line 58
The folder exists and can be written to. The image didn't upload to the folder though |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 09 April 2013 : 08:10:49
|
Your problem is in the forward slash after "Uploaded", it has to be replaced with a backslash.
Use this command before line 57:
subfolder=replace(subfolder,"/","\") |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 09 April 2013 : 13:14:33
|
Hi Carefree, it still returns:
Microsoft VBScript runtime error '800a004c'
Path not found
/forum/outputFile_ads.asp, line 57
I tried swapping the Form Action to point to the original outputFile.asp file and it works then, however simply adding a '2' to the end of the original file name (ie outputFile2.asp) and changing the Form Action to outputFile2.asp causes the above problem..
I cannot see any other reference to the original file name in either the outputFile.asp file or the upload.asp file, so once again am baffled |
Edited by - Webbo on 09 April 2013 13:19:20 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 09 April 2013 : 22:06:57
|
That makes no sense to me, either. I'll test it here. |
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 13 April 2013 : 15:47:13
|
Hello Webbo,
What happens if you change line 57 to the following:
Not sure if it would work, but I found that I needed to add the strUploadUrl for one of my sites. |
Cheers, David Greening |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 14 April 2013 : 17:05:58
|
Hi David,
Nope still returns: Microsoft VBScript runtime error '800a004c'
Path not found
/forum/outputFile_ads.asp, line 57 |
|
|
Classicmotorcycling
Development Team Leader
Australia
2084 Posts |
Posted - 18 April 2013 : 04:31:03
|
Hi Webbo, I worked it out for you, simply replace you outputFile_ads.asp with the below:
Or simply revert back to the one that you had the issues with and rather than the following, add an extra 4 to the number 14 so it is 18:
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
So it looks like this at line 51:
pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-18
I trust that this will work for you.
|
Cheers, David Greening |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 18 April 2013 : 06:19:54
|
Never noticed the len statement, good catch. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 18 April 2013 : 17:09:48
|
Excellent, it works
What is the significance of the Len statement then, ie what did it do or not do ? |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 18 April 2013 : 22:39:07
|
The len statement specifies the LENgth of the string (in this case, the file path). When you added the "_ads" to the file names, you made the string 4 characters longer. |
|
|
Topic |
|