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 read this article below and play around with delete multiple records function in dreamweaver. Assume that all my database fields setup are exactly like the code below. I was able to follow the instruction and did everything excepted line# 29. Can someone give me a suggestion of the line# 29 suppose to be (in example if possible).....
I have created my own web mail system, and when the user has mail is automatically inserts it into a database. Now I need to be able to allow the user to delete the mail, either 1 or more at a time.
I have two select boxes, ones the option of what to do with the selected mail. Then I have another box which is only for the likes of moving mail to a different folder ( ie personal folders ).
Now When I select the mail I want to delete, then select Delete from the drop down box and then press submit, It should then loop through all the selected items and then delete them.
But when I try it doesn't delete them and doesn't provide an error, then I looked into it and used this: Code:
I have written an events diary for a client .. and they wish to have a system of multiple deletes so they simply use a check box to select the items to delete and then hit a button to remove the selected records form the database. as all iget is scripting errors. Is there a simple way to do this?
Someone advised me to use an IN statement to Delete multiple records, but all I get is :
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'ID In ()'.
I have followed several different tutorials but I get the same outcome! It doesn't seem to like the IN statement.... any ideas anyone ???
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.
I have to develop a page where, based on status some records are selected from the Access database and displayed. A checkbox is displayed beside every record.
Some checkboxes can be selected and the corresponding record should be deleted if the delete bottun is pressed.
I know how to select the records from the database and perform multiple delete. But do not know how to link the database and the checkboxes. Anybody has any ideas??
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.
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?
Does anyone know how i could print multiple records in a database using a series of check boxes on a webpage? i.e it prints all the records that have been ticked?
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 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.
I have a page with only one <input type=file ..> tag.
The page submits to itself with a "Save File to List" button. User browses thru the files and click the above button to add the file to a list. In the end user clicks "Submit" to upload all the files from the list to the server.
Problem # 1
I'm not sure how to save FILE type object collection/array, with every click of first button.
Problem # 2
How do I post that collection/array varaible when submit (2nd button) is clicked.
I have had a post previously that was regarding an image editing component for ASP, I had settled on csImageFile, which performed all the tasks I needed, and so I started looking for an upload component... Well ChestySoft also had a component called csASPUpload, which worked great, so I opted to get that too... Then I also noticed that ChestySoft also had a product that was an OCX control that allowed you to do a multiple post upload... which would be perfect for my uses. My question is, does anyone know of a free alternative to csXPostUpload, or should I fork out the $80 for a license? www.chestysoft.com
Is there a way where an end user can download multiple files with one click?
I have a database table that can return between 1 and 12 different filenames (JPGs). I'd like to have a single button on the page that will initiate the download of all of them simultaneously. Is this possible?
We know that we can use <input type=file ...> to upload one file per time to the server. My question is if there are some way to upload multiple files per time to the server. (Of course, we can use <input type=file ...> multiple times and then submit once.
But this is not what I want, because we have to click "browse" button several times to select multiple files before submit in this way.) "Upload multiple files PER TIME", I mean it. We can select multiple files in ONE time, submit in ONE time, and thus upload in ONE time. Are there any way to do that?
what i am doing in swf ------i have one Base swf file this Base swf call one another child 1 swf this swf call one another child 2 swf this is the concept . This is run clearly in out side, but i attached these files in aspx this is not run, only run parent file only Code:
We have a master page set up and it is tied to its css file through the standard method in the <head> tag. What I would like to do though is from another page inheriting the master page to add another link to a css file.
That way i can have the sites global file used to make the general apperance consistent, then make the internal content more flexible without destroying the current css file.
Is this a possible task? When i went into the main master page and tried to add a <asp:contentplaceholder id="additionCSS" runat="server" /> tag to the head. When this is done visual studio alerts me saying it doesn't recognize the tag 'asp'. Is there a way around this? We are only just rewriting the site to use master pages now so I'm still figuring it out.
I'm using Microsoft's ASPFileUpload routines and all works fine as long as my files are smaller than about 200K. For anything larger than about 210K, I get the following error:
Error Type: Request object, ASP 0104 (0x80004005) Operation not Allowed
On the .Upload method. Has anyone else experienced this problem with ASPFileUpload?
working on a "downlad-module" within a larger website, i tried several methods for downloading-files to the user.
mabye some basic infos first:
the website runs on win server 2003, using sql server 2000-database; pages are written in classic asp. The idea behind is, that all possible download-files (flyers, brochures, some it-stuff.. means pdf, docs, exe, zip-files.. "standard-mixed-stuff, i would say) are of course stored outside the website-root and are uploaded using a cms. for each file, the information is stored in a database (not the file itself). beside path and filename, also content-type, descriptiton, user-restrictions etc.
within the page, the user will than receive a list of possible download files. by clicking on the link, i redirect to a "download.asp"-page, where i just want to start the download by sending the file to the user. so far - so bad :-)
i tried 2 free components (TabsUpload; aspSmartUpload)and also a simple response.BinaryWrite and here´s the problem: everything works fine, as long as i am messing round with other file formats than ZIP (!). I can use the system for downloading pdfs, exe, docs... but when i want to dl a zip-file, the system "hangs up" (only the browser wants to connect endlessly.. its not a crash, because i can stop it by using ESC-key)
one interesting thing: when i use the the BinaryWrite-method, a file is downloaded - but of course not the zip file - it is a html-page with the wrong content-type ;-) using a text/hex-editor, you can find this error message: Response Buffer Limit Exceeded
possible solution for this would normaly be, to turn Response.Buffer = False but, for using either binaryWrite or one of the components, Response.Buffer should be set to True, as far as i know...
I have a problem with running multiple sql statements using asp. Basically if there is an error with any of the statements inside the query a rollback is done. the sql and rollback work fine, But on the actual asp page no error is detected unless it occurs in the first statement in the query. heres an example
<% Sql= " BEGIN TRAN INSERT INTO Users VALUES ('BLAH', 'BLAH') INSERT INTO TESTING VALUES ('SOMETHING','SOMETHING') IF @@error <> 0 ROLLBACK TRAN ELSE COMMIT TRAN " If Err <> 0 Then
Response.Write "error"
Else Response.Write "<p>Data has been added!<p>" End If
%> in that example if theres an error inserting into Testing the page will display 'Data has been added' even though it hasnt.