Delete Temporary Files
Is it possible to delete internet temporary files using ASP code? And maybe specify the extension of the files to delete?
View RepliesIs it possible to delete internet temporary files using ASP code? And maybe specify the extension of the files to delete?
View RepliesI have a website that we display images we have saved into a SQL Server 2000 database as binary BLOB. This is on a Windows 2003 Server. Just recently (a week ago) this website began to save the images it is displaying on the website as ASP pages in the Temporary Internet Files > IE.Content > Folder.
We have other websites where we use the exact same code and these do not save files on the server when they are displayed.
Here is the code to display the image:
Set rs = objConn.Execute( SQL )
Response.ContentType = "application/octet-stream"
Response.BinaryWrite rs("Product_Image")
SQL is the SQL String to get the image from database
When I add this code:
Response.ContentType = "image/jpeg"
The images still display on the website, but now are saved in the Temporary Internet Files folder as JPG's.
I've got a web-based "database admin console" that uses ADOX, etc. to query a database and return the tables, columns, etc to a form that I can then use to build SQL statements to run against that database. It's very "generic" - i.e., everything is dymanically created but pretty handy to have
If you send it a "SELECT" statement, it can print out a table on the screen showing your recordset. No big deal. What I'd also like to include is some way for users to get that output in a comma- or tab-delimited text file that they can use however they like. There are two ways I know of to accomplish thi
1) Create a big string as I step through the recordset - (strOutput = strOutput & "'" & objRS(I) & "," .....) and then slap strOutput into a <textarea>. This is probably not desirable because the user would have to copy all the content in that <textarea> and manually paste it into Notepad or whatever
2) Use the FSO. However, my limited experience with the FSO leads me to believe that I'd have to SAVE the resultant file before I can send it to users. I don't want to do that.
Does anyone have any suggestions about how else I can accomplish this? Or, if FSO is the way to go (which I suspect it is), bear in mind that my only exposure to FSO is in the context of .vbs files....are there any special tricks you need to use for ASP
How I can erase all the files from the cache of an ASP page, at the end of a session?
Is it possible?
Is it possible after i run my process i delete text files from server.
I run a process to read from text files after that i want to delete
these text files so that no one again run the process.I am using ASP.
Could anybody show me an example of code to upload files from a local drive, and delete files from the website. of course the easiest way to do that is to use any FTP client.
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 RelatedLinux Server with Chillisoft ASP.
How would I get an ASP page to delete an image file, probably a .jpg off the server.
Basically, what I want to do, is that when the user deletes a product item from the database, it will also delete the corresponding image file from the images folder. So that the server space doesn't just fill up with redundant image files over time.
If it makes any difference the image files are uploaded using a PHP script, I've no idea how it works, but it does.
I have a Product and that product contains some documents.The documents are uploaded to server and can be viewed in my asp application.
In admin module i have given option to edit or delete that product.In the event of edit just the records in the database get changed.But in the case of delete i have to do 2 things
1. Delete all the data related to that product.
2. Delete all the related documents for that product in the server.
So can anybody help me figure out how to delete a file using asp in ftp server.
I understand how to delete files within a directory using the Scripting.FileSystemObject.
However, how can I delete a directory using ASP 2.0 on an older IIS 4.0 server? Do I need to:
1. Delete all the files within the directory.
2. Change the directory's permissions.
3. Delete the directory.
Am I able to delete a directory without changing the permissions? Can I delete a directory with files inside the directory or does the directory need to be empty?
I need to create a script that deletes all pdf files in a folder that are over 1 day old. I know I need to use the file system object and datediff but can't for the life of me work it out. I am a bit of a newb when it comes to more complicated asp .
Does anyone have a script that does this or know of a tutorial that will teach me how to do it?
I am wanting to delete all files contained in a directory.
I won't have the name of the file...
Can i do this somehow??
I have client who has database full of crap. One field in the "property" table is imageurl. I have been able to successfully extract only the file name from the string, such as "2030323.jpg". All images are stored in a directory called "listings". What I am trying to do is to loop through the recordset, and read each imageurl.
If there is an image file in the "listings" directory, then delete the file. It appears that some fields contain imageurls that no longer exist in the listing directory. Here is the code I have so far, I almost had it, as it told me at one point the file didn't exist. Then I screwed up the code and this is where I am at: Code:
I try to do a multiple delete of files through FileSystemObject, but after deleting the first file, ASP gives me a "Permission denied" error. Below you see my code:
Set fso = CreateObject("Scripting.FileSystemObject")
For Each Item in Request.Form("filename")
delFile = path2 & "files" & Item
fso.DeleteFile delFile
Next
I know this is going to be blindingly simple but I've had one of those days where the more I search and try, the further away from finding the solution I am!
What I'm trying to do is really simple, but the last part of it I can't seem to get right... hopefully someone will spot it straight away.
<%
fPath = Server.MapPath(".")
qDate = DateAdd("d", -7, Now())
Response.write qDate
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder(fPath)
For Each i In Folder.Files
If i.DateCreated <= qDate Then
'objFSO.DeleteFile(i.Name)
Response.Write i.Name & "<br>"
End If
Next
Set i = nothing
Set Folder = nothing
%>
As you can see, I've got down to selecting all the week old files no problem, but when I come to execute the 'objFSO.DeleteFile(i.Name)' line - I either get file not found or nothing at all.
Something to do with the ServerPath?
I'm trying to delete files from the server and its not working. Can any one help please?
It says the file doesn't exist... where as the file exists...
I did a response.write for my delFile to make sure its there but it doesn't see the file... Code:
I keep getting this message onmy webiste. I have had to change from a DSN connection to a dsn less connection but i still can't get the site to work.
Link to the error message
Page
Here i sthe code that relates to the error message
Code:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" & _
"DBQ=ftp://SimonJohnstone/htdocs/Tpvsite.mdb"
objConn.open
I need to take some info from a SQL Database into an ASP (VBscript) web page, create a temporary vcs file (Outlook vCalender file) and use the SQL data to create the entrys for the appointment, then email it to someone as an attachment. Getting the SQL values is no problem. How do I go about creating, populating & sending the vcs file? its similiar to a txt file. Its plain ASP not ASp.net and I can't install any components onto the server. It has to be kept local.
View Replies View RelatedIs there a way to create an asp program which counts the number of impressions, clicks, leads and sales of a certain ad and post it somewhere else? I have actually reviewed some ad servers one of which is Adxpress by Valuead. It's a good one but it'll really cost some money.
View Replies View RelatedI have a script that generates varius entities of data, like this
Name__________Value
nameA_________2
nameB_________18
nameC_________4
nameD_________23
I want to 'response.write' these onto the webpage, but I want them to be ordered by the value (largest first). Can I create a temporary table, put the values into it, then call them back using the an SQL command? If so, how do I create 'temporary tables'?
i am developing a search engine. its like this. i have an asp from which gets the search string. i display a page with a wait symbol for 2 seconds (meta-equiv-refresh=2) and then transfer the control to the same page which would display the search results.
I think even this forum does this type of display. Now my question is how do i start searching for the entered string and stop displaying the wait page only when the search is finished.
i.e i dnt want a wait page to be displayed simply for two seconds and then show the search page. I want to ""show the wait page after the search is started and then stop displaying it and display the search results only after the result is got""
I use the ASP to genereate the excel file. We use the Excel.Application to create a excel. But we find many excel shortcut or directory shortcut under the C: or D:
How can we resolve it?
I have a form on my site that users must fill out before downloading a pdf document, however, i would like the form to send them an email with a temorary URL.
which they can click to download from, and which expires after 'x' days. is this an asp thing? or do i have to move to .net to do this?
i have written a stored procedure. depending upon different parameters, query is prepared as string and executed through exec() function. it returns a certain number of rows. stored procedure also contains a temporary table. the question is this how can i insert the rows returned by the query in to temporary table?
View Replies View RelatedI am using ASP + IIS + MS access, when running the following codes:
set Conn=Server.CREATEOBJECT("ADODB.CONNECTION")
conn.open "DRIVER={Microsoft Access Driver
(*.mdb)}; " & Server.MapPath("db.mdb")
The following erorr is show:
General error Unable to open registry key
'Temporary (volatile) Jet DSN for process 0x508 Thread 0x634 DBC 0x2181024 Jet'.
I have shared the MS knowledge base and try to grant the modify Permissions to IUSR_SERVER on the folder that holding the database, and set the script authority in IIS, the error is still exist. If I create a system DNS for that Access file and modify the second code as ...
conn.Open "AKmobile"
Another error is show:
[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data.
But there is no problem when conencting with MS SQL Server.
Why d I get this error?
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x18c8 Thread 0x1478 DBC 0x2f56fa4 Jet'.
/wheelofgod/search/cat/showbook.asp, line 102
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0xa60 Thread 0xb30 DBC 0x1391ec4 Jet'.
/name.asp, line 17
my code:
All time that I go to make login to enter in admin is appearing this error:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x120c Thread 0x1494 DBC 0x1690024 Jet'.
/noticias/config.inc, line 6
In line 6 of config I have this: .....
Can a php file be executed inside an asp file? I need to execute a php file in another asp file but i'm not so sure it's possible.
My server can run both asp and php and they run without any problems... I just need to find a way to include the execution results of the php file in the asp one.
Is it possible to use SSI and include the executed php file and then the executed asp file in a main ssi file?
I have installed PWS in windows 98 in each of the system at various places and put my Sales program files in the WWWROOT directory in all the branches. I'm afraid that the users may tamper my ASP files. Is there any way of converting .ASP files to .exe files so that the dont see my program.
View Replies View RelatedI have this code that deletes a file using FSO but it wont work Code:
View Replies View RelatedI am trying to delete all the records from one table and insert a few in the same table.
When I run the asp it gives me the error message
"Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Could not delete from specified tables."
Before opening the connection to the database, I tried setting the mode to 3 as follows:
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Mode= 3
Then I open the connection. But it still gives me the same error.
How do you delete from the objRs when you choose the value to be deleted form a dropdown menu?
View Replies View Related