Hi All,
I have a problem.
I have been tasked to produce a upload page, this all works great but i wanted some validation and msgbox popups.
Basically if a file already exists i want the user to be prompted "File blahblah already exists do you want to overwrite it?" And a simple yes no box.
The checking for file existence is done within the loop of uploading files on the server side. It then writes a message box to the client.
' Loop through the uploaded files
For Each File In Uploader.Files.Items
FileCount=FileCount + 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strDirectory & File.FileName) then
Response.Write "<script language=""vbscript"">MsgRet = MsgBox ("" File " & File.FileName & " already exists, would you like to overwrite it?"", vbQuestion + vbYesNo + vbDefaultButton1,"" WARNING"")"&CHR(10)&"Document.Write(MsgRet)"
Response.Write "" & CHR(10) & "</script>"
' Save the file
File.SaveToDisk strDirectory
' Output the file details to the browser
'Response.Write(MsgRet)
Response.Write "<b>Thank you for your upload </b><br>"
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
End If
Next
I cant seem to access MsgRet variable from my server side run script, although i can use document.write(MsgRet) to display it on the page.
Please help
Mark
I have a problem.
I have been tasked to produce a upload page, this all works great but i wanted some validation and msgbox popups.
Basically if a file already exists i want the user to be prompted "File blahblah already exists do you want to overwrite it?" And a simple yes no box.
The checking for file existence is done within the loop of uploading files on the server side. It then writes a message box to the client.
' Loop through the uploaded files
For Each File In Uploader.Files.Items
FileCount=FileCount + 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strDirectory & File.FileName) then
Response.Write "<script language=""vbscript"">MsgRet = MsgBox ("" File " & File.FileName & " already exists, would you like to overwrite it?"", vbQuestion + vbYesNo + vbDefaultButton1,"" WARNING"")"&CHR(10)&"Document.Write(MsgRet)"
Response.Write "" & CHR(10) & "</script>"
' Save the file
File.SaveToDisk strDirectory
' Output the file details to the browser
'Response.Write(MsgRet)
Response.Write "<b>Thank you for your upload </b><br>"
Response.Write "File Uploaded: " & File.FileName & "<br>"
Response.Write "Size: " & File.FileSize & " bytes<br>"
Response.Write "Type: " & File.ContentType & "<br><br>"
End If
Next
I cant seem to access MsgRet variable from my server side run script, although i can use document.write(MsgRet) to display it on the page.
Please help
Mark