Author |
Topic  |
|
drexelbit
Starting Member
4 Posts |
Posted - 15 May 2007 : 15:37:22
|
I am using Mike's attachment, I want to save the attachments to another local drive, say D:\test or E:\test, can I do this and how? i tried to change the parameter for Server.MapPath, but it didn't work, I have also setup permission for the D drive and still not working, any idea? thanks |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 15 May 2007 : 16:11:39
|
I am not sure about Mike's, but I am told Proeder's is very similar.
In Proeder's you would have to change a number of occurances of the server.mappath as it is referenced a number of times in each of the MOD's files. You can either work with virtual directories and the mappath or replace the mappath references with a local path to the file location.
Hope this helps some. |
 |
|
drexelbit
Starting Member
4 Posts |
Posted - 15 May 2007 : 16:55:58
|
thanks, PPSSWeb, I have tried both, can you give me more details on the how? also, if the topic has been covered, could you please provide me a web link? thanks again |
 |
|
drexelbit
Starting Member
4 Posts |
Posted - 16 May 2007 : 10:00:23
|
update: making progress.. :)
1 step, I created a virtual drive (name it "test") at IIS and map to my another local hard drive, say D 2 step, I modified the outputfile.asp as follow,
4th line: subfolder = "/test" 45th line: memberPath = (Server.MapPath("/test") & "\" & membername)
and now, guess what, a folder has been created at my D drive, but it is empty, I think the path has been set up correctly, but the file didn't load. any suggestions?
|
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 16 May 2007 : 10:09:13
|
With the Proeder's File Attachment MOD, you need to modify all areas in the files admin_attach.asp, myfiles.asp, and outputfile.asp that reference the path.
These references are best found by looking for Server.mappath. You will see that the path is constructed by using the the pathend and deleting the filename from the mappath variable.
If you wanted to use another location on the same drive you would simply increase the number of spaces removed from the end of the mappath string. Then add to the string using the strUploadUrl or by hard coding the extra directory information.
If instead you want to use a location on another drive, as you mentioned before, you would have to replace the whole string with a local path (ie, Path = "D:\uploads").
I have only tried this with Proeder's and it works fine if you make ALL the changes in ALL the locations. |
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 16 May 2007 : 10:11:24
|
quote: Originally posted by drexelbit
update: making progress.. :)
I just tried using virtual directories on my installation with Proeder's and it did not like using another drive. It failed indicating that the drive did not exist and the path it followed was still related to the local physical path on the IIS partition. |
Edited by - PPSSWeb on 16 May 2007 10:12:18 |
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 16 May 2007 : 10:25:03
|
I just downloaded a copy of Mike’s from SnitzBitz. In comparing it with Proeder’s, they are very similar in how they establish the path. Mike’s should be even easier as it seems to only have 2 locations in one file (outputfile.asp) that need to be changed.
Change Line 45:
memberPath = (Server.MapPath("uploaded") & "\" & membername)
To:
memberPath = ("<physical path>\" & membername)
Change Line 51,52:
To:
' pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set MyFile = ScriptObject.CreateTextFile(memberPath & "\" & filename)
Where <physical path> is your location on the other drive (ie, "D:\test"
I tried this on my server with a copy of the outputfile.asp from Mike's and it worked. |
Edited by - PPSSWeb on 16 May 2007 10:25:27 |
 |
|
drexelbit
Starting Member
4 Posts |
Posted - 16 May 2007 : 13:34:38
|
PPSSWeb, it works great! thank you again for your help... |
 |
|
PPSSWeb
Junior Member
 
312 Posts |
Posted - 16 May 2007 : 13:40:52
|
No problem, glad it worked for you.  |
 |
|
|
Topic  |
|