PDA

View Full Version : FSO getfile() across network?


Spudhead
01-06-2004, 01:38 PM
Hi,

I'm having all sorts of problems with this. There is a data file that gets automatically uploaded to the database server box - lets call him \\BARRY. The file is imported by means of a DTS package into SQL Server sitting on that box.
However, I also need to *get at* that file from the webserver machine, let's say \\KEITH.

So, from an ASP script running on \\KEITH, can I do:

set oFile=oFSO.getFile("\\BARRY\E:\datafolder\datafile.txt")

Should that work? Will getFile work across network paths?

Assuming it should, then if it doesn't work (which, the more astute of you may have correctly concluded, it doesn't) am I right in assuming that it's either because:
1. I'm a muppet who hasn't defined the path correctly.
2. KEITH can't actually see BARRY.
3. KEITH can see BARRY, but ASP scripts running on KEITH don't have permissions to go poking at files on BARRY.

=============

Secondly, assuming I've been smacking myself about the face with this all chuffing morning, is it possible to write a SQL stored proc that will sit in the database on BARRY - which we know CAN see this ****ing file cos there's a DTS on there that imports it - and that will return the file's last modified date if it exists, and something small and non-hazardous (like an empty string, or the word "Figaro") if it doesn't? What would the gist of a SQL script like that look like?

Thanks for all suggestions and messages of support. Barry says hello.

glenngv
01-06-2004, 01:47 PM
You must share the folder the data file is in. And set the permission so that IUSR_KEITH account has read access to it.

Then in your asp code:

set oFile=oFSO.getFile("\\BARRY\sharedfolder\datafile.txt")

Haven't tried this though, but it's worth a try :)

Spudhead
01-06-2004, 01:53 PM
Hmm. If it's a permissions/network access issue, then I don't think it's going to be resolved. I don't have control over the database server, heck I'm not even supposed to be able to see it from here. Our network is tighter than a scottish accountant.

Sooo - the SQL route. Is it possible? Can anyone point me in the right direction to get started? My SQL is ok but I don't know how to start getting at the directory structure of the machine that SQLServer is running on, from within SQLServer.

BigDaddy
01-06-2004, 05:05 PM
I'm having the same type of issue. Using fso, I can get to a file on our mail/dns server, copy a file from the root of the web server, but I can't get to a file from our file server.

At first, it almost sounded like spudhead was describing my problem...as my real name is Keith. :)

Anyway, we've granted access to EVERYONE on the folders in question, and set the permissions exactly the same on the folders on each server--but no dice.

Kind of defeats the idea of allowing users to download files from our file server...