deleting files from web server directory

S

Simon

I've made a little file uploading utility that uploads files to a specific
directory into the webserver (in vb.net). It also stores the name of the
uploaded file into a database table. I'm not sure where to start if I want
to allow users to DELETE a particular file. Does anyone have sample
code/tips on how that is done? Thank you much.

Simon
 
G

Guest

Hi Simon,

It's very simple. Given a string "path" to the file:

Dim objFile as new FileInfo(path)
If objFile.Exists Then
objFile.Delete()
End If

That's it!
Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top