#12003/10/26 12:10:23
教程中说到
' 在我们删除该文件记录在数据库中的信息之前先删除文件!
Set File = CreateObject("Scripting.FileSystemObject")
ImagePath = Server.MapPath("..\upload")
ImagePath = ImagePath & "\" & (rsNews.Fields.Item("image").value)
' check if file exists and if true delete the file
' 判断文件是否已经存在,如为真则删除文件
If fileExists(ImagePath) Then
File.DeleteFile(ImagePath)
End If
我试了很多遍都不能删除掉图片
我的图片保存路径是相对路径不是文件名所以
' 在我们删除该文件记录在数据库中的信息之前先删除文件!
Set File = CreateObject("Scripting.FileSystemObject")
ImagePath = "rsNews.Fields.Item('image').value" <<<<<<<<改成这样也没错呀
' check if file exists and if true delete the file
' 判断文件是否已经存在,如为真则删除文件
If fileExists(ImagePath) Then
File.DeleteFile(ImagePath)
End If
为什么教程说的路径那一斜杠和我保存图片的相对路径的那一斜杠是反的,会不会是这里的问题
ImagePath & "\" & (rsNews.Fields.Item("image").value)
↑
而我保存的路径是以 /img
↑
请高手指点