Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Components / April 2005



Tip: Looking for answers? Try searching our database.

any way to write to the disk on local network?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vahan Babakhanian - 18 Mar 2005 23:55 GMT
I need to write a file to the disk
In my ASP scripts I use this

Set fso = CreateObject("Scripting.FileSystemObject")

Set ts = fso.CreateTextFile(path1 &file_name , True)
ts.WriteLine(eps1)
ts.Close

It works fine within same (local) HD(s)
path2="c:\vahan\"
.
It returns an error when target drive is on another PC in the LAN:

Microsoft VBScript runtime (0x800A004C)
Path not found

I tried both ways - by computer name like
path2="\\Braun2\c:\vahan\"

or by network drive like
path2="h:\vahan\"

neither works...

Is it possible to write to the (local) network drive?

Thanks for advices,
Vahan
McKirahan - 19 Mar 2005 00:44 GMT
> I need to write a file to the disk
> In my ASP scripts I use this
[quoted text clipped - 25 lines]
> Thanks for advices,
> Vahan

First, change
Set ts = fso.CreateTextFile(path1 &file_name , True)
to
Set ts = fso.CreateTextFile(path1 &file_name , ForWriting, True)
where
Const ForWriting = 2

Then use
   Server.MapPath(file_name)
instead of
   path1 &file_name
as the path must be relative to where your Web page is.

Or you can use a virtual directory to point to another folder.
Marius  Strumyla - 06 Apr 2005 22:30 GMT
See kb article 197964
http://support.microsoft.com/default.aspx?scid=kb;en-us;197964

Hope this helps
--
i5mast
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.