Author Topic: Uploading and storing big files (avoiding "max upload size" problem)  (Read 3965 times)

VladlenPopolitov

  • Newbie
  • *
  • Posts: 3
    • View Profile
The forum has a lot of cries regarding problems with big files uploads. I am speaking not about configuration of PHP, but implementation of upload in the  Feng Office code. This implementation can be considered as a bug, but it works fine for small files (below 10-20MB) and can be considered as feature.

I am speaking about the storage of the files in a database.

Currently Feng Office uploads a file to a server, then assigns the content of the whole file to a variable (!): whole file is read to memory. Then the code creates SQL command, and it includes the content of the previous variable - this file is read to memory twice (!). If PHP process is limited by 40M on the server, it can not store in the memory two 20Mb (or more) variable.

 What we need is it to make for-loop in the code and read the file by parts 64K or 1M and store these parts to database. To increase performance file can be stored not in 1 record, but in many records with additional field - number of part.
The required changes will be minimal, but result will be valuable. Current limit 4M or 8M is not serious, we are sending and storing much bigger files.

Best regards,

Vladlen.

cabeza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1004
    • View Profile
    • Feng Office
Re: Uploading and storing big files (avoiding "max upload size" problem)
« Reply #1 on: February 04, 2010, 04:31:34 pm »
Thanks for your feedback.

Do you want to help us by submitting a patch.