Page 1 of 1

Reading a file on the server side

Posted: Thu Feb 25, 2016 12:25 pm
by Joestes
I'm a bit confused. I used to use simple php scripts to read a (txt/csv) file (on the server side), but since version 1.20 there is a possibility to read a file directly with ReadFile, but no matter what I try, it doesn't seem to read without the filerequester... How do I do it? It Always seems to give #PB_Status_Progress (even if i try to load a file that doesn't exist!)

Code: Select all

Procedure ReadCallback(Status, Filename$, File, SizeRead)
  Select Status
    Case #PB_Status_Loaded
      SetGadgetText(0,"1")
    Case #PB_Status_Progress
      SetGadgetText(0,"2")
    Case #PB_Status_Error
      SetGadgetText(0,"3")
  EndSelect
EndProcedure

OpenWindow(0,0,0,200,200,"Test")
TextGadget(0,10,10,180,20,"")

ReadFile(0, "data/fladres.loc", @ReadCallback())
Thanks in advance!

Joost