i am unable to create new folders using file system object. the createfolder method doesnt work....the progress bar becomes slow...and no folder is created....but the other methods such as folderexists work....i have also checked the permissions...all folders have read/write..
I have used File System object to write contents in a text file. But when i request the page, it just processing without completing the job.. The writing to text file is not happening.
I have about 200 documents to which I need to write a header and a footer. Appending (the footer) is easy, but I cannot figure out how to write to the very beginning of the file.
when we use File system object in asp to read disk content of a server, in which sort order file system object reads and put all files in a list. well I put images in a folder and FSO reads and display on web page, I want to sort these images, for example by name or by date of creation.
How can I do that,If I have to do something with fso or, I can sepratly sort the listitem where fso stores the list.
I have a web site that uses NT authentication. It accesses a file on another server using FSO. The user has full control of that file yet when trying to access it via the website they get a Access Denied error. Shouldn't IIS use the current security context (which has rights to file) to access the file?
Can some tell me how can I search for a particular block of text within the file and delete it? Section of the file I want to change looks like the one below and I want all the lines starting with dteHolidays[ deleted?
/* INSERT HOLIDAYS HERE! */
dteHolidays[0] = new Date("01/01/2004"); // CHRISTMAS DAY dteHolidays[1] = new Date("04/09/2004"); // Good Friday dteHolidays[2] = new Date("04/12/2004"); // Easter Monday
I am building an upload script that overwrites any file with the same name, however the file could be a jpg, gif, bmp etc. Using 'fso.FileExists ' i can find if a file of the same name exists and remove it. The file will be saved as strMemberId.strFileExt. There is a possibility that file xyz.jpg may be re-uploaded as xyz.gif thus while the new image will be written to the folder the previous file will not be removed.
I am trying to find the best way of finding the file name of a file without the extension so I can delete any files that may exist with the same name but a have different extension. Is there a way of calling a wildcard in asp?
eg ' fso.FileExists(Server.MapPath("../tempfolder/" & strMemberId &".*" )) ' - tried this & several other combinations but it does not work.
The only other way I can see of doing it is to pass the file name into a string, strip the extension off it and then build an array to loop through the possible extensions but I am sure there is a better way.
I have script which is to check if a folder is existed. Even though the folder (virtual directory) is existed but the script objFSO.FolderExists() always return false. The script as following:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If objFSO.FolderExists("../images/thumb") Then Set objFolder = objFSO.GetFolder(Server.MapPath(strPath)) response.Write("Folder exists") else objFSO.CreateFolder(("../images/thumb") response.Write("not existed") end if
if it's possible to tell if a file is already open. If I have a file on the server that I just want to put log information to, and I don't want to have collisions obviously. Can I tell if the file is open already?
I would have the code loop until the file has been closed and then go ahead and do its thing. Alternatives are welcome. Databasing is an option, but I'd like to know anyway if the file can be "read" for open state.
I have recently built a web interface to handle files on my network at work. There has been another system in effect for quite some time, and we can't phase it out just yet. In this older system there is a lot of data pointing to files in a particular directory.
PHP Code:
// doesn't work. mypath=" heserversomedirectoryThat Has. a Decimal" // works mypath=" heserversomedirectoryThat doesnt have a Decimal" Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.Getfolder(mypath) Set fc = f.SubFolders
Does using the File system object multiple times across the page to check if relevant files exist use a lot of memory/server resource etc?
if this were the case, I was going to change this to check a DB field instead. ie when a file is uploaded then this is logged accordingle in the DB, then it can be this field used to check as to whether to display it or not - or are either equally.
Is there any way of rollback any changes made by the file system object in the event of an error. I delete a file and copy one somewhere and the copy fails is there anyway to rollback the delete. Essentially a file system version of a transaction.
I have created a function to remove file from the webserver, but it's not working of course...I am running IIS5.1 on WindowsXP. Here is a copy of my function Code:
i am looking into using the File System object on an intranet through ASP so as the user can move files from there local drive onto the server drive.
i have got the code working moving files from one local drive to another but a problem arrises when i transfer from a local drive to a mapped network drive (the server).
the errror is: Permission Denied
the mapped network drive has full read and write access.
any ideas as to why this is happening, or is there a better way?
I have a script that checks a database for records and saves each record set as an asp file. The script uses the "FileSystemObject" to do this and is run once a month, so I can create an archive. (I have been asked to do it this way for SEO reasons)
In my database there is a field for date, and this date is entered as dd/mm/yyyy. My question is if its possible to have the FileSystemObject create a folder for each month and save the asp files into it? Code:
the variables selectedFile and destination are valid paths to valid directories.
I submit the form and the file has been moved to from the source directory but does not appear to get moved into the destination directory. Any workarounds are alternative methods are welcomed.
I have tried the Move method but this has the same result as MoveFile. Also the Copy and CopyFile methods have the same result also (the file remains in source obviously)
I am using the File System Object to create server side cookies and part of the Function that I am writing deletes a file but I am getting a permissions denied error on that line of code.
I am using Integrated security only on this site but how do I get the IUSER_Machinename account to work with Integrated Security?
I used to have some static htm files which used to display data. There is a calling asp file which used to do something like below
if Request.QueryString("PageName").count = 0 then strPageNameHtm = "toc.htm" strPageNameInc = "toc.inc" else strPageNameHtm = Request.QueryString("PageName") & ".htm" strPageNameInc = Request.QueryString("PageName") & ".inc" end if strPageNameHtm = server.mapPath(strPageNameHtm)
strPageNameInc = server.mapPath(strPageNameInc) 'response.write(strPageNameHtm) set fs = server.createobject("scripting.fileSystemObject") set f = fs.openTextFile(strPageNameHtm) strSPDHtml = f.readall
The strSPDHTML info used to be displayed using a response.write(strSPDHTML). This allowed the static content to be loaded up.
I switched the static pages to be asp pages having the content come from a database. I would still like to maintain the controlling page logic. Can I modify the above section of code in anyways to access the asp page content
I'm using server.mappath to list a directory's contents. The code works fine, but the owner wants to know if there's a way to display the list by the date the file was posted, instead of the alpha order that it is presented by? I haven't been able to find an answer.
I've gotten a subroutine to almost work as I want it to, but it's refusing to show the newest file. It seems to choke on files created near midnight, just never showing them at all, and the date compare is showing an equal number for two different dates, though it surely shouldn't.
The code is running here: http://www.devedia.com/wiki/
The object is to show most recent file first, oldest file last. I have some leftover code in here to organize files by month created, but I removed the folders for debugging. The program moves any files created the previous month into a folder on the first of the month.
The folder name passed in is an X for recent files, a folder name (like 2005_04) when the files were sorted by folders.
What I'm hoping for from the intelligent people in the forum is either an eyeball on the subroutine to help me find where it's losing the midnight/most recent files, or a better idea on sorting by created date using the file system object and asp only. (NO recordset objects.)
And here is the subroutine. (sorry about the indenting... copy and paste it to read it better?)
I have a virtual path setup in order to give my web server access to a file on my app server. I am using the file system object to check for the existance of the file and if it exists, it has to validate the file date.
The problem is I can't seem to find the file. I can successfully check for the existance of a file on the web server, but once I enter the virtual path it can't find anything. All three of these calls return false...
This question has to do with MS file search but it is happening only with ..asp pages, so I though someone programming with .asp pages has experienced the same situation.
I'm trying to find .asp pages with a certain table name (i.e. "renewalInfo" )
When I ran the search I get no results. I know that I have that string in a couple of pages. My file system search engine is working fine with other file types, like Word documents, Excel spreadsheets, etc.
I tried typing the string outside the <% %> tags and when I do the search I get the file results, so it seems like if the search engine in my file system was not searching inside the <%%> tags. Code:
i am currently working on a project in which part of the requirements are to store files on the Server filesystem and make these files available for download by users. Is there a simple way to provide the user with a link which starts downloading the file when it is clicked?
I'm looking for an ASP (dotnet is alirght too) File Transfer system for use by internal employees and customers. I need to be able to control access to the system on a user and group basis and allow people to upload and download files.
I am using the below code to try and make sure a file exists before it is uploaded. When the below code runs and it does the fso.FileExists check, if strValue equals C:TestTestFile.txt, is the code looking on the web server or is it looking on the users machine to see if the file exists?
set fso = createobject("Scripting.FileSystemObject")
for each strValue in Request.Form("lstAttachments") If fso.FileExists (strValue) then Found = true Else Found = false End if next
The reason I ask is I assumed the code could look on the user’s machine. Is this possible? If not, I assume the logic a programmer needs to follow is first upload all files that need to be uploaded and then do the exists check. Is this correct?
The OS is Windows 2000. I have a asp with 2 frames. On the left I have a menu and one of the options open the file system on the right frame, using file://. My problem is that when a user double click a folder instead of showing the content of the folder only in the frame the content is showed in all the window, so I lost the menu on the left. This problem happen in win 2000, in winxp i have no problem.