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:
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
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 application that can upload real estate images to a website. The set of images is headed by a 'default' image. The default image is renamed to a prefix + property ID (example: DR91.jpg). The other images for the property are named differently. Their format is Prefix + property ID + time stamp (example: DR91_0401240231442.JPG).
The problem is if I delete or attempt to change the images for the property, the default image will either not delete from the admin area or when I get it deleted, I upload a NEW default image and it appears to be the same image.
I verified the default image is deleted from the directory (on the server) when asked to do so from the admin area. It looks like the image is cached, because the new file is the same name as the original default image (DR91.jpg) when the other images are not cached because they are named with a time date stamp and don't have the same name. Code:
This is doing my head in! I just want to know how I specify file name to correspond with the item ID (database). I've just changed hosting providers and my new server doesn't allow 'Upload.Save' method so I have to use 'Upload.SaveVirtual'
I need to read a SQL Server table into a Web Page and within the Web Page to permit my users to make changes to the records, delete or add new records and then save the entire contents back to the SQL Server table back.
The functionality I am looking is almost the same as In the SQL Enterprise Manager whereby I can choose a table open the table and then return all rows and I can maintain the same and save it back to the SQL Server table. I want almost a similar web interface to such a functionality.
Even if not a generic functionality as the SQL Enterprise Manager table maintenance appreciate if somebody can share the code with a sample how I can do it in ASP pages + T-SQL if need be.
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.
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 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.
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.
I would like to add a facility to my web page which allows users to upload basic files (word, excel, text, gif, jpg etc) to the server.
I know there's a facility to do this using HMTL forms, but I don't know how to handle the file on the server side.
What I think I need is an ASP file running some code to manipulate the filesystemobject, allowing me to receive the file and store it in the filesystem on the server. It would be nice to access some of the file properties too (name, type etc).
I've seen a few custom components online which allow you to do this, but I can't depend on installing them. I need to be able to script it myself.
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 have an asp page, which displays graphical images.I am using Flipper graph in my application.
There is a link in the asp page "Click to view Image file",On clicking on this link,The graphical image need to be stored(Preferably in the server machine) and has to be opened in a new browser window.
To explain in detail. On clicking of that link"Click to view Image file" a function is called which does the following
1)Save the image file(.gif file) on the server machine Graph.ImagetoGif("Location to be saved",100,200); 2) Opens the image on a new browser window.
window.open('from location from where the image is to be retreived',100,some more properties) So i need the image file to be saved in the server and retreived from the server.
I accept a few user inputs and a file from the user, post it to my ASP page. I'm able to receive the data as well as the file properly in Receiver.asp. In my receiver.asp, I need to process the user inputs and subsequently POST this data and the file again to a different server. I would like to use ServerXMLHttp. Now, how do I simulate Form creation in receiver.asp.
I use the following code to post to the second server MyXmlHttp.open "post", myTargetURL,false MyXmlHttp.setRequestHeader "Content-Type", "multipart/form-data"
Now here's where I get stuck.
1) How do I construct the form data? How can I put together the data i received (which is text) as well as the received file (which is Binary) in the same Send statement for the Post? -- I assume that if HTML forms do it in some format, I should be able to simulate the same through ASP, but how???
2) The received file will not be stored anywhere in my server. It has to be forwarded in memory.
I'm trying to create a dynamic page where I can edit a region from a simple admin area. I'm pretty confident that I can handle the database and asp coding (yeah who am I trying to kid) but what I want to be able to do is upload an image from the admin area too.
My hosting company is telling me that they have aspupload installed. Is this all I need and if so is there a tutorial anywhere that can help me on my way?
What I'm trying to do is upload an image(which I've managed with the sample code from the ASPUpload site),then I want to rename the image to a number, namely the value of an autonumber field in my Access database.i.e. 1.jpg, 2.jpg etc
I have no problem retrieving the autonumber etc it's the renaming part I'm struggling with.I'm using ASPUpload v2
Could anyone post some sample code or point me to somewhere that covers this.I've had a search around and can't seem to find much.