Page 1 of 1

VBScript,wait until file upload then exe script

Posted: Sun Nov 15, 2009 7:24 pm
by ismailc
Good day, I need help.
I have an application that uses aspx pages together with vbscript window for developer coding.
Now the page has an

Code: Select all

<input type='file'>
upload object.
The problem is that on the same page submit button i'm uploading the file AND executing vbscript command that renames & emails the file that is been loaded.
It keeps on crashing as when it looks for the file to rename the file has not uploaded yet.
Is there a way in vbscript where i wait untill the file exists & then continue with the other vbscript code. The uploaded file is given a unique name on the server eg: test.txt would be given a uniqueid+test.txt
But importantly the code behind on sthe submit button should not just ignore & continue - it should wait untill the wiating/checking script to execute first.
I'm not sure if what i'm asking is possible.
Please Assist

VBScript,wait until file upload then exe script

Posted: Mon Nov 16, 2009 2:55 pm
by ismailc
Unfortunately not winning & running out of time, I get an error: "Unspecified Error"
I can see the files have not uploaded & then get the error
Do While NOT objFSOFile.FileExists(strVE1090INTCreditApp) Application.Wait( Now + timeValue("00:00:03")) Loop if objFSOFILE.FileExists(strVE1090INTCreditApp) then fcTrigger = "VE20Creditors" end if
1. Does it not do the loop successfully before it goes on to the next code?2. How do i prevent it from going in an indefenite loop?3. While the file is being uploaded & trying to check for file is it not in a lock state.
Please help & provide code as you can see i have no vbscript knowledge & working off the example posted & google search
Thanks