Announcement

Collapse
No announcement yet.

unable to check that if file exists on web servervor not?

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

  • unable to check that if file exists on web servervor not?

    can someone please help me to build code that checks if certain file exist on server or not! I have tried but failed!


    please kindly reply!!

    thank you!

  • #2
    I got it ))

    Comment


    • #3
      maybe share how you did things with others this well stop half opened posts going to waste.
      Plugins or Sources MokoX
      BunnyHop 2021 Here

      Comment


      • #4
        here is the solution
        --replace HTTP.GetFileSize(replace your web server settings here)
        FileSize = HTTP.GetFileSize(sFileOnServer, nServerMode, nServerTimeout, nServerPort, tAuthData, tProxyData, nil);
        if FileSize ~= -1 then
        Label.SetText("Label2", "File found")
        end

        Comment


        • #5
          Beware that not all servers send a Content-Length header for dispatched content, this might fail in some occasions.
          Perhaps it's better to test for a HTTP 200 OK or HTTP 404 Not Found
          Bas Groothedde
          Imagine Programming :: Blog

          AMS8 Plugins
          IMXLH Compiler

          Comment


          • #6
            THANK YOU IMAGINE PROGRAMMING

            IT IS RATHER A GOOD IDEA AS YOU SUGGEST --if (http_error.Status < 200 or http_error.Status > 299) then
            I ALSO NOW SUGGEST THIS.

            Comment

            Working...
            X