Loading...
 
Architecture / Installation

Architecture / Installation


Broken Download from Files Stored in Directory

posts: 31 United States

I have my files being uploaded to a directory instead of directly to the db. Uploading works great, however, when you try to view a file listed in the file gal, you cannot do so.

Here's what happens:

When I click on the document link in the list of files, I get a dialogue box asking me to choose whether to Open or Save the file. When I choose Open, it proceeds to launch the hosting application, eg Adobe Acrobat, but then puts up a message box saying, "There was an error opening this document. File does not exist."

Interestingly, you can download the file (by choosing Save in the above mentioned dialogue) and it will save the file fine, but if you try to Open the file directly from the server, the host application cannot "see" the file.

This doesn't happen when the files were uploaded directly into the db, as opposed to putting them in a separate directory.

Ideas, oh wise TikiWiki gurus?

posts: 1001 Canada

Hum, maybe I'm asking about something already mentioned, but does this work with other file formats?
And did you tried on different browsers?
If yes, I'll try to reproduce.


posts: 31 United States

This works regardless of browser or file type on my end. I have tested it on 3 machines now.

Interestingly, the same thing happens with the File Gallery on tikiwiki.org. For example, if I go to http://tikiwiki.org/tiki-list_file_gallery.php?galleryId=2 and click on a zip file or pdf, they both fail to load.

Does this do the same for you?


posts: 111 Taiwan

There is an obvious problem, but I found out that you can
wget ".../tiki-download_file.php?fileId=xxx"
and you get the file correctly. I suspect a header problem.
fix is on the way.

mose


posts: 31 United States

Awesome. I'm glad I'm not losing my mind here.

I'll hang tight for the final fix. No sense in trying to explain this workaround to my users.

Please let me know when the fix is in. I'm kinda at a standstill.


posts: 111 Taiwan

here is the fix, I wonder how it is there, I'll induire more about the context and the upstreaming of the solution.

edit lib/tikilib.php replace line 1459

$query = "select path,galleryId,filename,filetype,data from tiki_files where fileId='$id'";

by

$query = "select path,galleryId,filename,filetype,data,filesize from tiki_files where fileId='$id'";

(the difference is in the filesize)...

Thanks for your reporting !

mose


posts: 31 United States

Thanks, Mose.

FYI: Please note that this fix does not work retroactively. In other words, while all new uploads now download fine, the files uploaded before this fax cannot be downloaded.

P.S. Can you tell me where the text for various error messages is kept? I'd like to edit these to be a bit more descriptive, but cannot find a central file.


posts: 31 None

I still have this bug in my Tiki v1.8.5.

FYI: The directory in on linux server and i upload files from windows box.