Loading ...
Sorry, an error occurred while loading the content.

1470Re: how to copy large file to blob

Expand Messages
  • Shadow Warrior
    Jul 1, 2005
    • 0 Attachment
      Hi sumon,
      Saving large files in a database hampers the performance at a great
      extent. You should not perform this, rather you can store the file in
      a secured directory in server and save the filename in database.

      before 4/5 months, I was appointed to debug a software. In which they
      store image of all members in MSSQL db. The developer company
      guranteed that the software will not collapse or slow down. But the
      truth is that whole system collapsed after insertion of 2000 records.
      Each select query took arround 3-4 minute to complete. This happen
      only for using those ***** blob fileds without planning.

      Thanks for you snippet. Take care

      Hasin Hayder



      --- In phpexperts@yahoogroups.com, Sumon <sumon_ruet99@y...> wrote:
      >
      > Hi xprets,
      > Pls inform how I can save a large file to mysql
      > table.
      >
      > I read an uploaded file by the function fread() as
      > ////////////
      > $tmp_file=$HTTP_POST_FILES['userfile']['tmp_name'];
      > $fp=fopen($tmp_file,"rb");
      > $song=fread($fp,filesize($tmp_file));
      > $song=addslashes($song);
      >
      > mysql_query("insert into mp3_song
      > values('$id','$song')");
      > //////////////////
      > then if I save the variable '$song' to database table
      > at the field longblob, then if the file is greater
      > than 2mb,Then it is not saved to database.but <2mb is
      > saved.
      >
      > Here I configured my php.ini, where maximum upload
      > size
      > 28MB(which is by default 2mb), memory 32MB, the
      > maximum size of post data 32mb(which is by default
      > 8mb)and the necessary changes as i know.
      >
      > I can copy the large file (>2mb) to other directory,
      > but not to table. So please help me about the filesize
      > and php.ini and other which is needed for it.
      > NB:- Here the Apache server is at WINDOWS OS
      > ///////
      > Again,the Apache server at Linux-7.2 os the files of
      > type *.mp3,*.wma, etc I cannot upload. When I select
      > these type of files by form and submit it to next
      > page,
      > The browser cannot find the file, but This is not
      > happened for *.jpg, *.doc etc.
      >
      > Plese inform about the problem and how it can be
      > solved.
      > Thank u all.
      >
      > __________________________________________________
      > Do You Yahoo!?
      > Tired of spam? Yahoo! Mail has the best spam protection around
      > http://mail.yahoo.com
    • Show all 18 messages in this topic