Author Topic: Solved: Downloading of uploaded files doesn't work  (Read 13257 times)

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Solved: Downloading of uploaded files doesn't work
« on: January 30, 2009, 06:04:39 pm »
Downloading of uploaded files doesn't work. I always get empty files after download (without any error messages).

Have tested it with .pdf and .txt.

Solved: It was an issue with my server.
« Last Edit: February 10, 2009, 01:29:36 pm by Karl »

werner.wuerfel

  • Sr. Member
  • ****
  • Posts: 319
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #1 on: January 31, 2009, 07:02:16 am »
Hi Karl,

I just testet this with .txt; .xls; .pdf; .jpg and .mp3 files under Version 1.2beta2. There are no problems to download the uploaded files.

I tested this with firefox3 and IE7

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #2 on: February 01, 2009, 08:18:14 am »
Strange, we (not only me, all the team member) are always getting empty files.

Obviously it's a matter of the web server. But what?

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #3 on: February 05, 2009, 10:54:54 am »
@ OpenGoo team:

Any idea about what causes this?

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #4 on: February 06, 2009, 09:53:50 am »
Hi Karl,

Have you noticed any error messages? Have you set the DEBUG config to true? Can you try a fresh install on the same server and see if it happens there too?

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #5 on: February 07, 2009, 02:36:51 pm »
Hi Ignacio,

No error message, DEBUG config is "true".

I made a fresh installation on the same server and it happens there too.

I'm sending you a link to phpinfo on my server via PM, so you can have a look at my PHP settings.

Karl

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #6 on: February 09, 2009, 10:23:30 am »
Hi Karl,

I didn't notice anything wrong in the phpinfo. Is this new to OpenGoo 1.2 or does it happen with OpenGoo 1.1 as well? Are you using FileSystem storage?

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #7 on: February 09, 2009, 11:31:00 am »
Hi Ignacio,

I didn't use download with 1.1 so I can't say anything about.

Yes, I'm using FileSystem storage.

Karl

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #8 on: February 09, 2009, 01:28:35 pm »
Try if this changes anything. On 'application/controllers/FilesController.class.php', try changing code on line 127 from:
Code: [Select]
if (FileRepository::getBackend() instanceof FileRepository_Backend_FileSystem) {
$path = FileRepository::getBackend()->getFilePath($file->getLastRevision()->getRepositoryId());
if (is_file($path)) {
// this method allows downloading big files without exhausting php's memory
download_file($path, $file->getTypeString(), $file->getFilename(), $file->getFileSize(), !$inline);
die();
}
}
to:
Code: [Select]
/*if (FileRepository::getBackend() instanceof FileRepository_Backend_FileSystem) {
$path = FileRepository::getBackend()->getFilePath($file->getLastRevision()->getRepositoryId());
if (is_file($path)) {
// this method allows downloading big files without exhausting php's memory
download_file($path, $file->getTypeString(), $file->getFilename(), $file->getFileSize(), !$inline);
die();
}
}*/
(just surround it between /* and */)

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #9 on: February 09, 2009, 02:22:16 pm »
Yes, it helps. Now I can download the files.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #10 on: February 10, 2009, 09:49:37 am »
Hi Karl,

Let me further refine the cause of this bug. Are you able to download backups? Are you able to export contacts and events?

Try putting the file I'm attaching somewhere in your server, access it in your browser and tell me if the download link works.

Thank you very much.

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Re: 1.2: Downloading of uploaded files doesn't work
« Reply #11 on: February 10, 2009, 11:46:34 am »
Hi Ignacio,

is your file test.php really complete? It ends with:

Quote
<html>
<body>
<a href="?do

There isn't anything more after:
Quote
<a href="?do

Karl

Karl

  • Sr. Member
  • ****
  • Posts: 339
    • ICQ Messenger - 464979879
    • View Profile
Solved: 1.2: Downloading of uploaded files doesn't work
« Reply #12 on: February 10, 2009, 01:24:58 pm »
It seems that it was an issue with my server: It was setup too restrictive. I had to remove "readfile" from "disable_functions" in php.ini.

Now I removed the "/**/" in "FilesController.class.php" and the download works fine.

Karl

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Solved: Downloading of uploaded files doesn't work
« Reply #13 on: February 11, 2009, 11:14:00 am »
Great, because that function will allow downloading big files from OpenGoo, which you would otherwise not be able to do because you would exhaust PHP's memory.

I tried downloading the test.php file I uploaded seems to be OK (it should be 1289 bytes long).