Hello Drupal-Community,



I found a problem with the upload of files with the filefield 6.x-3.3 field. I maintain a application system and

the users upload documents in there Content Profile Nodes over a file field. However, the filefields store the

documents on the server in differed folders (each field one folder). Drupal download method is set to private.

Each folder contains up to 300 documents. The file names, given by the users, are mostly similar. The module

changes it during the storage process by adding a number (filename_number).

The Problem: in some cases, the downloaded files (PDF-files) are corrupt / damaged.

Example: original upload-file = 200Kb, download-file = 4Kb

Findings:

The upload-file ,stored on the server path /sites/*mysite*/files/*filefield-folder*, is fine. I can download it over a

FTP-Program and it has the original size/I can open it.

The file I download is not available in this folder (no file with a size of 4Kb).

If I delete the file on node-edit and upload the original again it leads to the same result: original has the name

Transcript.PDF, during upload the filefield module changes the name to Transcript_11.PDF which has the proper

size of 200Kb on the server, the download file I get 4Kb. The server-folder file name, the filefield module gives

this file (Transcript_11.PDF), is every time the same although the server-folder contains also Transcript_12.PDF,

Transcript_13.PDF and so on. If I change the file name to Transcript_username.surname.PDF the module displays

the hint the filename is changed out of security reasons. This hint doesn't show up by upload Transcript.PDF and

automaticaly rename to Transcript_11.PDF. The original uploade file (name changed to Transcript_username.surname.PDF)

is renamed by the module to Transcript_username.surname_.PDF and after download it has the right size and I can open it.

Summary: In some case the automatic renaming of file names or the download-process it selves doesn't work proper.

For some Ideas how to solve this problem I would be thankful.


My Installation:

Drupal 6.16

File system Writable (private download method)

MySQL database 5.1.37

PHP 5.2.10-2ubuntu6.4

PHP memory limit 192M

PHP register globals Disabled

Unicode library PHP Mbstring Extension

Upload progress Enabled (PECL uploadprogress)

Web server Apache/2.2.12 (Ubuntu)

getID3() 1.7.8b3

jQuery UI 1.6

Some Modules:

FileField 6.x-3.3

Content Construction Kit (CCK) 6.x-2.6

Content Profile 6.x-1.0-beta4

getID3() 6.x-1.3

Comments

jason.lally@gmail.com’s picture

Any success on this? Having a similar problem.

quicksketch’s picture

Title: Download file (PDF) from filefield is corrupt / damaged » Automatically renamed files may not be able to download through private file system

Thanks for the reports here. I don't usually use the private download system, so there very well may be a problem as you described. I think I experienced this problem the other day during testing, but I didn't indentify that it was caused by the automatic file renaming. I'll have to have another look.

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

I'm still at a bit of a loss on this problem. I haven't seen it reproduced successfully since this report was filed. I'll need a step-by-step instruction on how to reproduce in order to fix this.

quicksketch’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)