Re: PHP Upload Script - Files uploaded Corrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 16 Aug 2006, Matthew Benjamin wrote:

Can anyone help I have a php script that uploads files to a mysql database.
When it uploads the files all of the content in the file gets corrupted. Has
anyone expirienced this. I know I can't be the first person with the
problem. -- Help!!!  Please.


Are you escaping the data from the file?

here would be a working php script:

      $fp=fopen($addfile,"r");
      $bvar=fread($fp,filesize($addfile));
      fclose($fp);
      $bvar=addslashes($bvar);
      $q="insert into table (file) values ('$bvar')";

ed


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux