HI can any body give me a program for delete a online file in asp. Actually I have created a program for mail attachment. For attaching the file first of all I have to upload the file in a directory but after sending attach file the file should be remove from directory.
I need to delete files across the network using web client (IE 6.x) in Win 2003 - IIS 6.0 environment.suggest an approach I can use to acheive this.Will using FSO do the job or I have to go COM way.
what r things that I have to do to let the client browser to delete a file on the server. I'm running my server on WIN2000 pro, IIS 5.0. I've stored my website and server in a virtual directory. This is the code i use to delete a file from the server folder
Code:
Function delete_file(exceldb) '***************** Delete********************** Set fso = CreateObject("Scripting.FileSystemObject") Set fileObject = fso.GetFile(Server.MapPath("..upload2uploads"& exceldb))
fileObject.Delete Set fileObject = Nothing Set fso = Nothing ' Deletes exceldb End Function
What is the easiest way to 1) delete a File System Website Solution and 2) rename a File System Website solution?
I noticed when I create the ASP.NET Web Site (via File System location option) that I get one directly with my code (.aspx etc files). but the solution is under the default Visual Studio directory. So I assume if I delete these two directories then my solution is really gone?
Renaming a solution seems to be a bit more tricky - what would be the easiest way to rename the solution and the associated directory with the acutal code (.aspx etc files)?
if I had a form using the input textboxes using username and password. how do I use the .asp language to remove the line from a .txt using the following format:
We have offer a web space to hosting our client website. We offer them to upload asp files to their web space. How can I prevent the client from uploading asp files that will harm our web server.
For example, deleting files in our server using Scripting.FileSystemObject to delete our systemmfiles.
Ok, the following page uploads files to the server and renames them according to the item ID and database table (or update type). It also replaces existing files. There are potentially 5 files for each item ID (see FILE REFERENCE). 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 have the setup working close to what I am after. The upload script I am using has been supplied by 'Lewis Moten'.
Basically what I am after is.
A job application contact form. that includes a input="file" element allowing the user to send a CV, to the address related to that job.
So far locally I have the file uploading, the file sent, and then the file deleted all working fine. Althoug this may well work locally I feel I will have problems when I come to trying this live. Mainly due to timings.
Surely the script would need to know when the file has been uploaded completely, also when the file has been sent completely before delete....
I have an Access DB with newsletter preferences in it. What I am trying to do is select small groups to send a custom newsletter out to. So my localhost criteria web page goes to the Access DB and pulls the email addresses that match my current criteria. I then write that list out to a file (newsletterlist.txt). Maybe that is my problem, but I wanted to do that so if my machine crashed while processing, I would know where to recover it. I had looked at arrays and dictionaries but dictionaries aren't good from what I found for hundreds of entries and arrays I can't keep track of..argh.
Anyways, I then wanted to loop through the file (newsletter.txt) find the next email address, with it I can query back to the DB and get preferences and assemble the email and out the custom newsletter goes.
I've seen where MS says deleting a line using the FileSystemObject is not possible, though wanted to see if anyone has found a work around.
Performance isn't that much of an issue for me, as I figured I'd set the thing to running and go to dinner! So anyone have suggestions - even if it means taking the text info to an array, somehow delete one of the addresses and then put it back to a file...anything that can one by one delete the addresses so I know that it all has worked as there would be no email addresses left in the file.
Past few days I see following errors in Event Log after which few ASP scripts stopped working (or part of it's functionality - not very sure which one).
"Error: File /trxweb/trxweb.asp Unexpected error. A trappable error (E06D7363) occurred in an external object. The script cannot continue running.." Source : Active Server Pages Event ID : 5 Category:None
What could have caused this error ? We are using IIS 6.0. This happens between 3:00 pm and 6:00 pm. User not is on an avg < 40.
When I type out my new stuff in the edit field I click submit and get this error. The next post is my code for the entire page. Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. /hwnetwork/edit1.asp, line 110
I have perhaps not explained myself clearly, so I'll try it this way. In the code below, where it says "I'd like to include my navigation bar here" is the place I'd like to insert a navigation bar from a page I have called navbar.asp
For some reason, when I insert the <! #include file="navbar.asp" --> in that place, I get an error, a long, hairy error. Can you please look at the code below, and tell me how I should write the code so that the include statement will work? Code:
We recently moved our webserver from Win2K to Win2003. The application works fine. Only problem is that when user views a report as a PDF, IE does not show it. The following code is used to redirect:
IE opens a "File Download" box and if you click the "open" button then nothing happens. If you click the "Save" button the following error comes up:
"Internet Explorer cannot download "myreport.pdf" from "website". Internet Explorer was not able to open this Internet site. The requested site is either unavialable or cannot be found. Please try again later."
I have a form that has many fields on it (selection list, text areas, etc) as well as the ability to upload some files. I'm using Lewis Moten's upload code (works great). No problem so far. However, if the user has a typo or the file does not exist then I want to return the user to the original form with an error (invalid file) and all of their work the way it was before the submission (i.e. if they had selected something from a list - when returned to the form the selection is kept).
Because I'm uploading files I have the form set as this:
In my addform.asp, I have a check for a valid file:
set objUpload = new clsUpload
if objUpload.Fields("document").Length = 0 then ' redirect user back to original page with an error Response.Redirect addform.asp?error="invalid file" end if
On the original form, I have quite a bit of data - may exceed the querystring maximum.
There is an ASP page in my site which sometimes gives file not found error. This page which is suppossedly missing exists on the server and available most of the time. But sometimes out of the blue, we get this message. When we restart IIS, the page works fine.
The rest of the site is usually fine. This one page gives the 404 error consistently. Obviously anything after this page could not be accessed. There are some other ASP pages as well which become unavailable (giving file not found errors) from time to time.
I am getting one error while downloading a file (DBF file) through aps page. the error is: "Can not access file because the file is being used by another process". First My asp page creates a DBF file programmatically using OLEDB provider and saves that file at a particular location. In the same asp page I have given link to download the file on client machine.
above operation will be performed based on the flag set in my code. if flag is 'Save' it will create the DBF if flag is 'Download' it will download the DBF. I am using ASPSmartUpload component to download the file. and i am calling DownloadFile method of this component. But it is giving me error as mentioned above. I have closed the recordset and connection object and set it to Nothing. but still it is giving this error. This works fine for the first time and after that it gives this error.
please tell me what could be the reason for this and how i can handle this programmatically. is there a way to find out whether the file is in use or not and if yes then how to stop that process?