Reading Server Files
I have files on a server. I want to read the SERVER's File system and write out the filenames to the page. how can i do this?
View RepliesI have files on a server. I want to read the SERVER's File system and write out the filenames to the page. how can i do this?
View RepliesIs it possible to display a doc file within an ASP page and have it show the header and footer of the page?For example,in ColdFusion you can use cfcontent to display doc files, however any html on the containing page doesn't show.I was hoping that with ASP, it would show the HTML of the page that reads the doc file.
View Replies View RelatedI have several files and directories and I want to read the contents, seperate them into fields and INSERT them into a database.
The structure is as follows:
D:DISCSSC8849SC8849-01 Artistname - title.zip
D:DISCSSC8849SC8849-02 Artistname - title.zip
D:DISCSLG114LG114-01 Artistname - title.zip
I want to read every file in D:DISCS, seperate the filenames into: Disk Number, Track Number, Artist and Title - drop the .zip and the hyphens entirely and insert the data as a record in a database.
I was under the impression if I had a page with several database queries to 3 different databases, it would be faster if I just had the queries cached to text files since the query result won't change that often and I build the cache manually when needed.
So my question is would it be faster to just include text files instead of doing multiple Access and SQL queries on a web page?
Assume that there are 100 flash files in a directory and i want to load 4 flash. files for every page and list of links in a row previousPage.page1.page1.page3.........page10.Nex tPage) How can i divide
100 files into pages and 4 filash files on every page. is it possible to use files systemobject to createpages or sholud i record content of directory of files to a database and then use recordset to create pages.
In ASP, using PerlScript, how do you read and write to files?
View Replies View RelatedI'm planning a little asp prog that will allow me to read&write .ini files.
meaning, read lines that are:
key=value
and maybe even read from groups (optional):
[group 1]
key1=value1
[group 2]
key2=value2
i am working on a page which calls an asp page on another server with some xml and then gets some xml back. the page calls and returns the xml fine but trying to display that xml properly is the problem.
here is the code:
Code:
set req = Server.CreateObject("Msxml2.XMLHTTP")
req.Open "POST","http://www.domain.com/xmldata.asp", false
req.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
req.send "username=foo&password=bar"
resp = req.ResponseText
response.write(resp)
so basically it just dumps raw xml into the browser at the moment. Code:
Consider the following code snippet:
<%
Dim objFSO,objOpenFile,strPath
strPath=Server.MapPath("ADList1.txt")
Set objFSO=Server.CreateObject("SCRIPTING.FILESYSTEMOBJECT")
Set objOpenFile=objFSO.OpenTextFile(strPath,1)
Do While Not objOpenFile.AtEndOfStream
Response.Write(objOpenFile.ReadLine() & "<br>")
Loop
objOpenFile.Close
Set objOpenFile=Nothing
Set objFSO=Nothing
%>
When I try to execute the above code, the code never gets executed. Neither
am I shown a script timeout error. After a lot of investigations, I
concluded that the code is not getting executed due to the presence of
Set objOpenFile=objFSO.OpenTextFile(strPath,1)
If I comment line nos. 3 to 8, then the code gets executed but as expected
without any output. Is this happening because of some permission which has
not been given to IIS 5.0? If so, what is it? I am working on Windows 2000
Professional.
I understand i can not use Scripting.FileSystemObject to read a file that resident on another server and i need to use something else.
View Replies View RelatedI use the following code to read the server's mimemap and resove a file extension to a mime type:
Public Function GetMimeType(ByVal Extension)
Dim oMimeMap
Dim vntMimeType
Dim avntMap()
Set oMimeMap = GetObject("IIS://LocalHost/MimeMap")
If Left(Extension, 1) <> "." Then Extension = "." & Extension
avntMap() = oMimeMap.MimeMap
Code:
i understand i can not use Scripting.FileSystemObject to read a file
that resident on another server and i need to use something else.
I need to read a simple txt file where there are some variables. I've done
this a lot of times but in this case I have something different: the text
file is located at an ftp server.
The FTP server has anynomous access.
Anyone know how can I do this?
I've got a stored procedure which returns a select query on a linked server. This works fine if i call within SQL and Query Analyser but if i try and execue to return data to a ASP recordset i get the ridiculous
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB error trace [OLE/DB Provider 'MSDASQL' IDBInitialize::Initialize returned 0x80004005: The provider did not give any information about the error.].
Am i missing something really basic like a simple setting or is it just not possible.
Heres my ASP code: ...
the source code is:
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.OpenTextFile(Server.MapPath("") & "/learn.txt")
mystring=a.readAll
Response.Write ("<pre>" & mystring & "</pre>")
Set a = Nothing
Set fso = Nothing
%>
The output is:
abc
ABC
i don't understand this:
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fso.OpenTextFile(Server.MapPath("") & "/learn.txt")
what should be insect in ("Scripting.FileSystemObject")?
and what should be insect in (Server.MapPath("") & "/learn.txt") ?
I am looking for a system that will:
1. Read a message from a POP3 mailbox
2. Parse the message into its parts
3. Create a record in an SQL server table with selected fields of the message
4. Upload the attachements to the filesystem
5. Write the path of the attachements to the SQL server record
For security reasons, I want the process to be initiated and approved
by a user.
Does anybody know of a good way to get a list of emails from the corporate
exchange server from a corporate website?
If I have multiple websites on the same server,can I use the #include directive to reference include files elsewhere on the server? I tried this -
<!--#include file="C:InetpubvhostsATRAMEMBER.COMhttpdocsheader.asp" -->
But no dice...
I have an application that needs to pull files from an internal server. This
is the setup. The web server is external facing, meaning exposed to the
internet. I then have a file server that sits inside our domain. I created a
COM object that can impersonate a user to retrieve files from that server.
However, I cannot get the application to pull files from the internal server.
I first tried a domain account that could reach both servers. This did not
work. I then had the network team create the same account on both machines.
This is not working either. I can impersonate the user (I am able to get the
user/users authenticated), but the script keeps coming back with and access
denied. Code:
How can i transfer files from one web server to another web server. Is it possible?
View Replies View Relatedif there's a way to copy image files from one server to another using ASP and FSO? Or perhaps some other way to do it? I'm trying to collect information on books, and want to have a picture of the book associated with the description, but I want to be nice and
host the pictures myself, not just link to other people's pictures. Is there a way to do this?
I found the complete physical path to the doman by Response.Write Server.MapPath(".") and the path is: C:Inetpubwwwrootmyweb"&"gg.txt
With this,there's still error to read my text file.The error source code is place at below,please help me do correction!!! Code:
is it possiable to write in asp program that will be able to analytics the server log files? any information on this subject will be good for me now cause i'm just starting...links...codes...any info...
View Replies View RelatedI am running a application create and write in a file it works fine as it writes on the same server. But I need to create & write it on the another server. Is it possible?
View Replies View RelatedI'm building an ASP site that needs to include some ASP files from another web server. Can I include them like traditional SSI or I have to use some special code or functions.
View Replies View Relatedi want to copy a file(.jpg, .swf ...) on the web, to my server. how can i
write this function? it should take an url of a file and past the file to my
server in related folder.
I need to allow a user to upload images to my website.
I can't use an asp.net solution, just asp 3.0.
I'm trying to develop a webpage that will allow people to upload pictures onto the webserver from their own PC's but don't have a clue where to start!
View Replies View Relatedi want to delete all files from a dir off the server any suggestions?I know how to delete specific files but i dont know how to delete all files.
View Replies View RelatedI am trying to create a file on another server, but I get either "Permission Denied" or "Path not found" errors. If it helps, the folder I am attempting to put it in is a shared folder. here is the path that I am trying to put the file in...Code:
set f=fs.CreateTextFile("192.168.50.15E:Common est.txt",true)
I am curious if anyone can help me to upload files to a server using asp. I am making an interface so user can upload any files to the dedicated web server.
View Replies View RelatedDevelopment environment: Windows 2003 Server running IIS6 and the same
server running as a domain controller, DNS and DHCP servers.
Production environment: Windows 2000 Server SP4 running IIS5 and not used
to provide domain control or name services.
The two environments are on different networks with no trust relationship
between them. In both environments the web server is set up to disallow
anonymous access and to use integrated Windows authentication. The
application is vanilla ASP (i.e. not .NET) VBScript.
In the development environment, the following code runs flawlessly no
matter whether "myUNCPath" points to a share on the web server or a share
on another server in the same domain.
Set objFilesys = Server.CreateObject("Scripting.FileSystemObject")
If Not objFileSys.FolderExists(myUNCPath) Then
Set objFolder = objFileSys.CreateFolder(myUNCPath)
End If
However, in the production environment it falls over with a permission
denied error when "myUNCPath" is on another server and further testing
shows that the FolderExists method is returning false even when
"myUNCPath" exists. The network share is configured to give full control
to the Everyone group.
I've found http://support.microsoft.com/kb/207671 which although
referring to IIS4 suggests that the issue could be the authentication
method (I'm assuming that integrated Windows authentication is close
enough to NT Challenge/Response and so might generate a token that cannot
access network resources). I'm not sure of this is the problem because if
it were then the code shouldn't work in my development environment.
Any ideas on what's going wrong and how to access the network resources
in the production environemt?
I have an admin page for adding pictures to a stock list, currently it browses and uploads from a local pc to the server but can you browse, say,the images folder on the webserver?
View Replies View Related