Hi,
glad to be of help.
first replace the line in your code with
Please note - the order is important
you have to replace the $filename with whatever your filename is or your variable that represents the file name
the second point is that you are reading in chunks of 10MB each. this is way too much. try a lot smaller value would be kinder on your server.
all the best
[code]
print "Content-Disposition: inline; filename=\"$filename\"
[/code[