See Also

User Contributed Notes 2 notes

Pay attention that if you omit the "length" parameter it will read a 8192 bytes object regardless to its real dimensions. If you want to use this function think to save the object size somewhere (usually a field in its table) before reading the object. Alternatively use the pg_lo_readall function.

//headers to send to the browser before beginning the binary downloadheader('Accept-Ranges: bytes');header('Content-Length: 32029974'); //this is the size of the zipped fileheader('Keep-Alive: timeout=15, max=100');header('Content-type: Application/x-zip');header('Content-Disposition: attachment; filename="superjob.zip"');