3 Replies - 6094 Views - Last Post: 16 November 2009 - 11:51 PM Rate Topic: -----

#1 ismailc  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 98
  • Joined: 14-September 07

VBScript - wait until file has been uploaded then execute script

Posted 16 November 2009 - 04:18 AM

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
<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

Is This A Good Question/Topic? 0
  • +

Replies To: VBScript - wait until file has been uploaded then execute script

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: VBScript - wait until file has been uploaded then execute script

Posted 16 November 2009 - 07:11 AM

hi :)

simple delay can do the work. like Sleep() function
Was This Post Helpful? 0
  • +
  • -

#3 ismailc  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 98
  • Joined: 14-September 07

Re: VBScript - wait until file has been uploaded then execute script

Posted 16 November 2009 - 07:18 AM

Please help, I'm not winning
		  Do While objFSOFILE.FileExists(strVE1090INTCreditApp)				  'Len(strVE1090INTCreditApp) <> 0 
				 Application.Wait (Now + TimeValue("0:00:03")) 
			Loop 

		  if objFSOFILE.FileExists(strVE1090INTCreditApp) then


Was This Post Helpful? 0
  • +
  • -

#4 ismailc  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 98
  • Joined: 14-September 07

Re: VBScript - wait until file has been uploaded then execute script

Posted 16 November 2009 - 11:51 PM

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
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1