thedust2010 Posted August 2, 2006 Share Posted August 2, 2006 I have a URL that when entered returns a file. It's something like http://yourdomain.com/file.php?fileID=43433. If I enter that URL I will get the image or document that I'm looking for. No HTML at all. Just the file.Now, I'm trying to use the following line to capture that file in order to include it in a zip file using the following line:[code]$fileContents = file_get_contents("http://yourdomain.com/file.php?fileID=43433")[/code]It is returning true, but the file is always less than 4K. It's not grabbing the contents of the file, even though it is returning true. The thing is I HAD this working at one point, but now I don't know what is wrong... does anyone have any ideas on why this might be happening to me? Or examples of how others have done this? Link to comment https://forums.phpfreaks.com/topic/16362-using-get_file_contents-with-a-dynamic-url/ Share on other sites More sharing options...
shocker-z Posted August 2, 2006 Share Posted August 2, 2006 Not 100% but have you tryed simply using$fileContents = file("http://yourdomain.com/file.php?fileID=43433");http://uk2.php.net/manual/en/function.file-get-contents.php"Identical to file(), except that file_get_contents() returns the file in a string, starting at the specified offset up to maxlen bytes."Maby reaching a set max somehow?RegardsLiam Link to comment https://forums.phpfreaks.com/topic/16362-using-get_file_contents-with-a-dynamic-url/#findComment-68044 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.