Hi, thanks for your help.
I have just tried it that way and still isn't working.
I tried printing out $bytesread but it seems to have no value. I also checked if the filename that gets passed to my code is correct and that's the case. Am I missing something?