Jump to content

Recommended Posts

Posted

Can anyone confirm or deny that FileSystemObject methods need local paths not URLs ? I am trying to create a txt file on a hosted system and they are saying that you can only use urls for security as is standard security.

 

Is this true? So there is no way to write a txt file to an IIS webserver?

Posted

I suspect what they're telling you is that they're not going to let you write files like this. ASP certainly supports it:

set oFso=server.CreateObject("scripting.filesystemobject")
sRoot=server.MapPath(".")
set oFile=osfo.createtextfile(sRoot & "\" & test.txt)
oFile.writeline "Testing"
oFile.close

 

(server.mappath just works out "where am I?" - it will return something like c:\inetpub\wwwroot\mysite\myfolder)

 

The problem is that if you can write "good stuff" then a hacker can probably write "bad stuff"

 

What are you wanting to write? Could it be put in a database instead?

  • Thanks 1
Posted

Ta. Yeah sorry I know it does work, I have it running on a server here. It was mainly if they are right that it is standard not to allow it & then wondering what otehr people did if they are on hosted servers.

 

What I am doing is an emergency message system. If the school loses power or connection a page will be presented and I just wanted a text file to store time, date, message and reason that would be written by an admin page. Looks like I will have to stick with just uploading the text file.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...