Prevent loading from remote source if file is larger than a given size
Let's say I want XML Files only with upto 10MB to be loaded from a remote server. Something like $xml_file = "http://example.com/largeXML.xml";// size= 500MB //PRACTICAL EXAMPLE: $xml_file = "http://www.cs.washington.edu/research/xmldatasets/data/pir/psd7003.xml";// size= 683MB /*GOAL: Do anything that can be done to hinder this large file from being loaded by the DOMDocument without having to load the File n check*/ $dom = new DOMDocument(); $dom->load($xml_file /*LOAD only IF the file_size is <= 10MB....else...echo 'File is too large'*/); How can this possibly be achieved?.... Any idea or