Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

File being used by another process

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    File being used by another process

    I am doing some file upload checking but I cannot remove a file while using a WHILE LOOP. I get the error message
    "Error:Script: /LivePreview/$$A623.a5w line:48
    file.remove(filename)
    The process cannot access the file because it is being used by another process.
    C:\UploadedFiles\".

    below is the code I have in my fileupload page
    Code:
    dim msg as c = ""
    dim msg1 as c
    dim vUserFolder_name as c
    dim reg_num as c
    
    if eval_valid("submitButton")
    
     
    'check folder to see if user folder exists,the user folder is created during registration of user.  
    'if file.exists("C:\A5Webroot\UploadedFiles" "\\"+session.vUserFolder_name) = .T.
    	'Check to see if user chooses a file for upload
    	If FileToUpload.filename<>""
    'Check to see if user already uploaded a file with the same name
    	result=file.exists("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename)
     		 if result=.F.
    'Check to see if user uploads the correct file type
    			If right(FileToUpload.filename,3)=".c3" .or. right(FileToUpload.filename,3)="txt" 
    'Check to see if user chooses a file for upload that is less than the stipulated file size allowed
    				If FileToUpload.data.size() < 100000 ' checks size limit of image,25600bytes=100kb
    
       file.from_blob("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename, FileToUpload.data)
    
    
    file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename,FILE_RW_SHARED)
    msg=FileToUpload.filename + " was uploaded<br /><br />""</a> on"+" "+date()+" "+time()
    text= file_pointer.read_line() 'read the first line
    tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)
    Reg_num=word(text,2)
    filename="C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename
         while .not.file_pointer.eof()
    
          text = file_pointer.read_line() 'read the next line
    if Reg_num=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
    
    else
    file.remove(filename) 
    msg="<strong><font color=#800000>Wrong employer number included in file, Please check File and Re-Submit</strong></font>"
    end if
    
         end while
    'end if
    
    
    
    
    
    
    
    'If user tries to upload a file that is larger than the file upload size specified, this message is displayed
    else
    msg="<strong><font color=#800000>The size of the file you attempted to upload is " +format_data(FileToUpload.data.size()/1024,"B")+"K,the file selected must be less than 25k</strong></font>"
    	end if
    else
    'If user tries to upload a file other than the file type specified, this message is displayed
    msg="<strong><font color=#800000>The file must be a .C3 file</font> </strong></font> "
    		end if
    else
    'If user tries to upload a file that has already been uploaded
    msg="<strong><font color=#800000>File already Uploaded, please chose a different file to upload</strong></font> "
    end if
    'If user hits upload button without choosing a file show message 
    else
    msg="<strong><font color=#800000>Please select a file to Upload</strong></font> "
    end if
    
    
    end if 'Ends Nested If loop
    Anyone has any suggestions on how I can go about checking the file
    then removing it, if it doesn't meet the requirements or any file checking utilities I can use with alpha?

    Any suggestions would be welcomed
    Thank you


    Rogers
    ......

    #2
    Re: File being used by another process

    You want to terminate the process and remove the file if an invalid employee number is found?

    file_pointer.close() immediately before
    file.remove(filename)

    You also need

    tbl.close() after the while loop to close the table opened with
    tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)
    There can be only one.

    Comment


      #3
      Re: File being used by another process

      thanks I will try the suggestions given

      Comment


        #4
        Re: File being used by another process

        You probably also want

        EXIT WHILE

        after the

        file.remove(filename)
        msg="<strong><................

        to stop the processing.
        There can be only one.

        Comment


          #5
          Re: File being used by another process

          Thanks I am making some progress, however the pointer doesn't read past the second line . This is the code I have on the page. What am I missing? Some of my file checking only requires a read of the first and last lines, while others would require me to read the whole file. How do I accomplish this?

          Code:
          if eval_valid("submitButton")
          
           
          'check folder to see if user folder exists,the user folder is created during registration of user.  
          'if file.exists("C:\A5Webroot\UploadedFiles" "\\"+session.vUserFolder_name) = .T.
          	'Check to see if user chooses a file for upload
          	If FileToUpload.filename<>""
          'Check to see if user already uploaded a file with the same name
          	result=file.exists("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename)
           		 if result=.F.
          'Check to see if user uploads the correct file type
          			If right(FileToUpload.filename,3)=".c3" .or. right(FileToUpload.filename,3)="txt" 
          'Check to see if user chooses a file for upload that is less than the stipulated file size allowed
          				If FileToUpload.data.size() < 100000 ' checks size limit of image,25600bytes=100kb
          
          
          
          
          file.from_blob("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename, FileToUpload.data)
          file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename,FILE_RW_SHARED)
          msg=FileToUpload.filename + " was uploaded<br /><br />""</a> on"+" "+date()+" "+time()
          tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)	
          text= file_pointer.read_line() 'read the first line
          filename="C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename
          Reg_num=word(text,2)
          version=word(text,4)+(".")+word(text,5)+(".")+word(text,6)
          Period=extract_string(text,"/",",")
          NewPeriod=stritran(Period,"/")
          chkfilename=reg_num+NewPeriod+".C3"
          
          
            while .not.file_pointer.eof()
          
          
          text = file_pointer.read_line()   'read the next line
          
          
          
          if FileToUpload.filename=chkfilename=.T.
           
          if Reg_num=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
          
          if version= "1.0.0"=.T.
          
          ? text
          
          else
          file_pointer.close()
          file.remove(filename)
          msg="<strong><font color=#800000>Wrong version format of File,Please check File and Re-Submit</strong></font>"
          end if
          
          else
          file_pointer.close()
          file.remove(filename) 
          msg="<strong><font color=#800000>Wrong employer number included in file, Please check File and Re-Submit</strong></font>"
          end if
          
          else 
          file_pointer.close()
          file.remove(filename) 
          msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
          end if
          exit while
            end while
          
          tbl.close()
          
          'If user tries to upload a file that is larger than the file upload size specified, this message is displayed
          else
          msg="<strong><font color=#800000>The size of the file you attempted to upload is " +format_data(FileToUpload.data.size()/1024,"B")+"K,the file selected must be less than 25k</strong></font>"
          	end if
          else
          'If user tries to upload a file other than the file type specified, this message is displayed
          msg="<strong><font color=#800000>The file must be a .C3 file</font> </strong></font> "
          		end if
          else
          'If user tries to upload a file that has already been uploaded
          msg="<strong><font color=#800000>File already Uploaded, please chose a different file to upload</strong></font> "
          end if
          'If user hits upload button without choosing a file show message 
          else
          msg="<strong><font color=#800000>Please select a file to Upload</strong></font> "
          end if
          
          
          
          end if 'Ends Nested If loop
          Thanks
          Rogers
          .....

          Comment


            #6
            Re: File being used by another process

            Code:
            			
            						ELSE
            							file_pointer.close()
            							file.remove(filename)
            							msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
            						END IF
            						exit while
            					END WHILE
            Should be

            Code:
            			
            						ELSE
            							file_pointer.close()
            							file.remove(filename)
            							msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
                                                                    exit while
            						END IF
            						
            					END WHILE
            There can be only one.

            Comment


              #7
              Re: File being used by another process

              Thanks again Stan.
              However I am now getting an error message

              "end while
              The handle is invalid.
              "

              Comment


                #8
                Re: File being used by another process

                I saw where I went wrong. I needed to put Exit While after each File Remove Operation.

                Thanks

                Comment


                  #9
                  Re: File being used by another process

                  Stan Thanks for your Help and quick responses.
                  I have progressed quite a bit.

                  I am at the point now where I added this piece of code (highlighted in blue)in the same area I have the other If statements just before the file remove operations

                  Code:
                    while .not.file_pointer.eof()
                  text = file_pointer.read_line()   'read the next line
                  
                  
                  if FileToUpload.filename=chkfilename=.T.
                   
                  if Reg_num=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
                  
                  if version= "1.0.0"=.T.
                  
                  [COLOR="RoyalBlue"]? *any(word(text,2),"000000")=.T.
                  
                  [/COLOR]
                  else
                  file_pointer.close()
                  file.remove(filename)
                  msg="<strong><font color=#800000>Wrong ssn in File,Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                  
                  
                  else
                  file_pointer.close()
                  file.remove(filename)
                  msg="<strong><font color=#800000>Wrong version format of File,Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                  
                  else
                  file_pointer.close()
                  file.remove(filename) 
                  msg="<strong><font color=#800000>Wrong employer number included in file, Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                  
                  else 
                  file_pointer.close()
                  file.remove(filename) 
                  msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                    End while
                  
                  tbl.close()
                  and I get back this result, which is correct: FalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalse

                  However when I try to put this in an If statement as shown below,I get back the result False and it doesn't remove the file. It seems like it is only reading the first line. How can I correct this?
                  Code:
                    while .not.file_pointer.eof()
                  text = file_pointer.read_line()   'read the next line
                  
                  
                  if FileToUpload.filename=chkfilename=.T.
                   
                  if Reg_num=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
                  
                  if version= "1.0.0"=.T.
                  
                  [COLOR="RoyalBlue"]
                  if *any(word(text,2),"000000")=.T.
                  
                  else
                  file_pointer.close()
                  file.remove(filename)
                  msg="<strong><font color=#800000>Wrong ssn in File,Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if[/COLOR]
                  
                  
                  else
                  file_pointer.close()
                  file.remove(filename)
                  msg="<strong><font color=#800000>Wrong version format of File,Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                  
                  else
                  file_pointer.close()
                  file.remove(filename) 
                  msg="<strong><font color=#800000>Wrong employer number included in file, Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                  
                  else 
                  file_pointer.close()
                  file.remove(filename) 
                  msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
                  Exit While
                  end if
                    End while
                  
                  tbl.close()
                  Thanks
                  Rogers
                  ......

                  Comment


                    #10
                    Re: File being used by another process

                    Not sure of the logic flow.

                    Code:
                    if *any(word(text,2),"000000")=.T.
                    [COLOR="red"]'found the sequence "000000"[/COLOR]
                    [COLOR="Red"]'don't you want to have the close and exit here[/COLOR]
                    else
                    [COLOR="red"]'didn't find the sequence "000000"
                    'should proceed as usual and not exit?[/COLOR]
                    file_pointer.close()
                    file.remove(filename)
                    msg="<strong><font color=#800000>Wrong ssn in File,Please check File and Re-Submit</strong></font>"
                    Exit While
                    end if
                    There can be only one.

                    Comment


                      #11
                      Re: File being used by another process

                      What I am trying to accomplish is this:
                      Loop through the file and
                      If it finds the sequence "000000"
                      then I want it to upload the file
                      else If it doesn't find the sequence I want it to remove the File

                      Comment


                        #12
                        Re: File being used by another process

                        and I get back this result, which is correct: FalseFalseFalseFalseFalseFalseTrueFalseFalseFalseFalse
                        The first false encountered triggers the file remove and the end while in blue. No other lines in the file are read.
                        There can be only one.

                        Comment


                          #13
                          Re: File being used by another process

                          Thanks again for your help Stan.

                          Comment


                            #14
                            Re: File being used by another process

                            I am seeking help again. I have the following code in my fileupload page


                            Code:
                            <%a5
                            'dim userid as c
                            'dim session.__protected__Puser.ulink as c
                            'session.__protected__Puser.ulink = userid
                            
                            tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)
                            	tbl.change_begin()
                            dim hst as c hst = alltrim(request.host)
                            filename = "loggedin"
                            filename = filename + "__" + time("0h0mA")
                            filename = filename + "__" + alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"User_fname","registration","Employer_Id"))+" "+ alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"User_lname","registration","Employer_Id"))
                            filename = filename + "__" + hst
                            filename=filename+a5_split_url(request.script_name).page
                            filename = stritran(filename,".",".")
                            filename = stritran(filename,":",":")
                            filename = stritran(filename,"@","@")
                            filename = stritran(filename,":","_")
                            
                            filename = filename +".txt"
                            save_to_file("loggedin",session.session_folder + filename)
                            
                            tbl.change_end(.t.)
                            	tbl.close()
                            
                            
                            
                            
                            dim msg as c = ""
                            dim msg1 as c
                            dim fn as c=""
                            dim reg_num as c
                            dim version as c
                            dim vUserFolder_name as c
                            dim text_lcv as C
                            Dim LastLine_lcv as C
                            dim lines_lnv as N
                            dim ss_lpv as P
                            
                            tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)
                            	tbl.change_begin()
                            vUserFolder_name=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Folder_name","registration","Employer_Id"))
                            'check folder to see if user folder exists,the user folder is created during registration of user.  
                            if file.exists("C:\UploadedFiles" "\\"+vUserFolder_name) = .F.
                            'If user folder doesnt exist then create it
                            'file.dir_create("C:\UploadedFiles\\"+vUserFolder_name)
                            tbl.change_end(.t.)
                            tbl.close()
                            
                            end if
                            
                            
                            if eval_valid("submitButton")
                            
                             
                            'check folder to see if user folder exists,the user folder is created during registration of user.  
                            'if file.exists("C:\A5Webroot\UploadedFiles" "\\"+session.vUserFolder_name) = .T.
                            	'Check to see if user chooses a file for upload
                            	If FileToUpload.filename<>""
                            'Check to see if user already uploaded a file with the same name
                            	result=file.exists("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename)
                             		 if result=.F.
                            'Check to see if user uploads the correct file type
                            			If right(FileToUpload.filename,3)=".c3" 
                            'Check to see if user chooses a file for upload that is less than the stipulated file size allowed
                            				If FileToUpload.data.size() < 100000 ' checks size limit of image,25600bytes=100kb
                            
                            
                            
                            file.from_blob("C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename, FileToUpload.data)
                            file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename,FILE_RW_SHARED)
                            msg=FileToUpload.filename + " was uploaded<br /><br />""</a> on"+" "+date()+" "+time()
                            tbl=table.open("[PathAlias.ADB_Path]\registration.dbf",FILE_RW_SHARED)	
                            text= file_pointer.read_line() 'read the first line
                            filename="C:\UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename
                            HDRReg_num=word(text,2)
                            version=word(text,4)+(".")+word(text,5)+(".")+word(text,6)
                            Period=extract_string(text,"/",",")
                            NewPeriod=stritran(Period,"/")
                            chkfilename=HDRreg_num+NewPeriod+".C3"
                            Dim Date as D
                            Date=word(text,3)
                            HDRDate=word(text,3)
                            
                            while .not.file_pointer.eof().and. word(text,1)<> "FTR" 
                            
                            text = file_pointer.read_line()   'read the next line
                            
                            if FileToUpload.filename=chkfilename=.T.
                             
                            If HDRReg_num=alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
                            
                            If version= "1.0.0"=.T.
                            
                            
                            text2 = file.to_string("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUpload.filename)
                            reverse = Line_ReverseOrder(text2)
                            lines_lnv = line_count(text2)
                            LastLine_lcv=lines_lnv-1
                            'FTR=word(text,2)
                            ss_lpv = stringscanner.Create(text2)
                            text2 = ss_lpv.GetLineText(lines_lnv-1)
                            FTRreg_num= word(text2,2)
                            '? FTRreg_num
                            FTRDate=word(text2,3)
                            
                            
                            If FTRreg_num =alltrim(lookupc("F",alltrim(session.__protected__Puser.Ulink),"Reg_num","registration","Employer_Id"))=.T.
                            
                            
                            
                            If val(word(text,2))>123456 =.T. .and. val(word(text,2))<199999.or. val(word(text,2))=655637
                            
                            dim Monday as N
                            dim Tuesday as N
                            dim Wednesday as N
                            dim Thursday as N
                            dim Friday as N
                            dim Saturday as N
                            dim Sunday as N
                            dim enddate as N
                            
                            
                            Monday= DAY(MONTH_START(Date))+7+7+7+7
                            Tuesday=DAY(MONTH_START(Date)+6)+7+7+7
                            Wednesday=DAY(MONTH_START(Date)+5)+7+7+7
                            Thursday=DAY(MONTH_START(Date)+5)+7+7+7
                            Friday=DAY(MONTH_START(Date)+3)+7+7+7
                            Saturday=DAY(MONTH_START(Date)+2)+7+7+7
                            Sunday=DAY(MONTH_START(Date)+1)+7+7+7
                            
                            
                            
                            week4=Monday+Tuesday+Wednesday+Thursday+Friday+Saturday+Sunday
                            
                            
                            
                            
                            if week4+7 > day(month_end(Date))= .T. .and. val(word(text,13,","))=0 
                            '?  val(word(text,13,","))
                            ' ? text
                            '? val(word(text,13))
                            
                            
                            
                            if HDRDate=FTRdate
                            
                            else
                            file_pointer.close()
                            file.remove(filename)
                            msg="<strong><font color=#800000>Header Date and Footer Date does not match,Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            
                            
                            else
                            file_pointer.close()
                            file.remove(filename)
                            msg="<strong><font color=#800000>Only 4 weeks in the Month,Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            
                            
                            else
                            file_pointer.close()
                            file.remove(filename)
                            msg="<strong><font color=#800000>Wrong ssn in File,Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            else
                            file_pointer.close()
                            file.remove(filename)
                            msg="<strong><font color=#800000>Wrong Employer Number in Footer,Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            
                            
                            
                            else
                            file_pointer.close()
                            file.remove(filename)
                            msg="<strong><font color=#800000>Wrong version format of File,Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            else
                            file_pointer.close()
                            file.remove(filename) 
                            msg="<strong><font color=#800000>Wrong employer number included in file, Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                            
                            else 
                            file_pointer.close()
                            file.remove(filename) 
                            msg="<strong><font color=#800000>Wrong File Name, Please check File and Re-Submit</strong></font>"
                            Exit While
                            end if
                              End while
                            
                            tbl.close()
                            
                            'If user tries to upload a file that is larger than the file upload size specified, this message is displayed
                            else
                            msg="<strong><font color=#800000>The size of the file you attempted to upload is " +format_data(FileToUpload.data.size()/1024,"B")+"K,the file selected must be less than 25k</strong></font>"
                            	end if
                            else
                            'If user tries to upload a file other than the file type specified, this message is displayed
                            msg="<strong><font color=#800000>The file must be a .C3 file</font> </strong></font> "
                            		end if
                            else
                            'If user tries to upload a file that has already been uploaded
                            msg="<strong><font color=#800000>File already Uploaded, please chose a different file to upload</strong></font> "
                            end if
                            'If user hits upload button without choosing a file show message 
                            else
                            msg="<strong><font color=#800000>Please select a file to Upload</strong></font> "
                            end if
                            
                            
                            
                             
                            
                            
                            end if 'Ends Nested If loop

                            It was working fine but now I get the following message when I try to upload a file. I checked and the file uploads and the directory exists. I don't knw what is causing this. Any assistance would be nice.

                            500 Internal Server Error
                            "Script Error
                            Error:Script: /LivePreview/$$341.a5w line:53
                            file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUplo
                            The system cannot find the path specified.
                            C:UploadedFiles\655637Administrator/655637092009.C3"




                            Thanks
                            Rogers

                            Comment


                              #15
                              Re: File being used by another process

                              Originally posted by Rogers View Post
                              I am seeking help again. I have the following code in my fileupload page

                              It was working fine but now I get the following message when I try to upload a file. I checked and the file uploads and the directory exists. I don't knw what is causing this. Any assistance would be nice.

                              500 Internal Server Error
                              "Script Error
                              Error:Script: /LivePreview/$$341.a5w line:53
                              file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "/"+FileToUplo
                              The system cannot find the path specified.
                              C:UploadedFiles\655637Administrator/655637092009.C3"




                              Thanks
                              Rogers
                              file_pointer = file.open("C:UploadedFiles" "\\"+vUserFolder_name+ "\\"+FileToUpload.filename,FILE_RW_SHARED)
                              Andrew

                              Comment

                              Working...
                              X