|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-13 12:24 UTC] iliaa@php.net
[2003-08-13 13:01 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 13:00:01 2025 UTC |
Description: ------------ using addslashes() on large data fails. We tested with data size ranging form 4MB to 100 MB.It would fail around 36 MB of data. I have'nt tested this in the latest releases, however. From phpinfo(): PHP Version 4.2.3 System: Linux linuxbuild 2.4.9-e.3smp #1 SMP Fri May 3 16:48:54 EDT 2002 i686 Build Date Apr 29 2003 17:44:32 Server API Apache Virtual Directory Support disabled Thread Safety disabled Configure Command './configure' '--enable-shared=all' '--disable-static' '--enable-memory-limit=yes' '--enable-magic-quotes=yes' '--enable-debug=no' '--enable-inline-optimization' '--enable-mbstring' '--enable-safe-mode' '--enable-sigchild' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--enable-track-vars' '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-gd' '--with-xml' '--with-dom' '--with-ttf' '--with-gettext' '--with-ldap' '--with-curl' '--with-mcrypt' '--without-mysql' '--without-imap' '--with-pgsql' '--with-apxs' Reproduce code: --------------- <?php if ($upload){ $size=filesize($uploaded_data); $data = ""; if (is_uploaded_file($uploaded_data)){ if ($fp = fopen($uploaded_data, "r")){ $data = fread($fp,$size); fclose($fp); addslashes($data); print "Hello World"; }// end if (able to get uploaded file) } } else{ ?> <html> <form method="POST" enctype="multipart/form-data" name="testform"> <input type="hidden" name="MAX_FILE_SIZE" value="104857600"> <input type="file" name="uploaded_data" size="30"><br><br> <input type="submit" name="upload" value="Upload"> </form> </html> <?php } ?> Expected result: ---------------- We are storing the uploaded file into a table(Postgres). The uploaded data needs to be addslashes()'d before storing into the database. Actual result: -------------- There is no error in the error log, however the php hangs.