Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 file attachment to another local drive?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

drexelbit
Starting Member

4 Posts

Posted - 15 May 2007 :  15:37:22  Show Profile
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  Show Profile
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.
Go to Top of Page

drexelbit
Starting Member

4 Posts

Posted - 15 May 2007 :  16:55:58  Show Profile
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
Go to Top of Page

drexelbit
Starting Member

4 Posts

Posted - 16 May 2007 :  10:00:23  Show Profile
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?
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 16 May 2007 :  10:09:13  Show Profile
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.
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 16 May 2007 :  10:11:24  Show Profile
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
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 16 May 2007 :  10:25:03  Show Profile
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:
 pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & SUBFOLDER & "\" & filename)


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
Go to Top of Page

drexelbit
Starting Member

4 Posts

Posted - 16 May 2007 :  13:34:38  Show Profile
PPSSWeb, it works great! thank you again for your help...
Go to Top of Page

PPSSWeb
Junior Member

312 Posts

Posted - 16 May 2007 :  13:40:52  Show Profile
No problem, glad it worked for you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.42 seconds. Powered By: Snitz Forums 2000 Version 3.4.07