VBScript,wait until file upload then exe script

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
ismailc
Posts: 37
Joined: Mon Nov 09, 2009 6:11 pm

VBScript,wait until file upload then exe script

Post 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

User avatar
ismailc
Posts: 37
Joined: Mon Nov 09, 2009 6:11 pm

VBScript,wait until file upload then exe script

Post 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

Locked