File invalid problems with downloads from File Manager

Permalink
Hi, folks.

I'm using 5.4.2.2 to house a library of process documents, and everyone's pretty pleased with the results. However, we've run into a problem recently with file download issues.

We noticed it first when adding a link to a file that had been uploaded into the File Manager. One of my editors had loaded an Excel spreadsheet into the File Manager and then used the "Add File" button when adding content into a Content block. He highlighted the text he wanted users to click to download the file and clicked Add File, accessing the File Manager. He chose the Excel file and everything seemed fine.

In the resulting linked text, the link showed as "/c5 site/index.php/download_file/view/1220/". After publishing the page, hovering over the linked text showed a similar URL, but with "827/" appended to the end (e.g., "/c5 site/index.php/download_file/view/1220/827/"). Clicking on the link would indeed download an Excel file, but the file could not be opened in Excel. Even though the file had an Excel extension, the user would receive a message saying, "Excel cannot open the file <filename> because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file."

Upon returning to the page in Edit Mode, I noticed that the linked text now showed a link that read "{CCM:FID_DL_1220}" instead. I guess that's not a concern, since the link still functions in the same way. I investigated further. I went to the File Manager, clicked on the Excel file in question, and used the Download option to download the file. I received the same result when trying to open it. So I attempted a bit of a workaround. I selected the checkbox next to the file and selected the Download option from the drop-down menu at the top of the File Manager. This time, I received a ZIP archive, which I assumed contained the Excel file. However, when I attempted to open the archive, I received the following message: "Windows cannot open the folder. The Compressed (zipped) Folder <ZIP archive> is invalid. When I attempted to download a small image from the File Manager using both methods, I received similar results - an image file I could not preview from Windows because the file is "damaged, corrupted, or too large" or a ZIP archive I couldn't open. The image displays just fine in concrete5 pages, though.

So far, the only way I've been able to add a link that will allow a user to download a file from the File Manager and have it work afterwards is to go directly to the file in File Manager, click Properties, and copy the "URL to File" information. Then, in the Content block, I create a link and paste that information into the Link URL field. This information tends to look like "http://c5 site/files/2613/4026/5325/filename.xls".

It's as if the download process is creating corrupted files. I was unable to find anything in the forums that quite matched what I'm seeing. Does this sound familiar to anyone?

Thanks.

campbell
 
jbx replied on at Permalink Reply
jbx
Could you post up some browser information? This could be a browser issue. Let me know what browser and version you are using and I will try and replicate the issue...

Jon
campbell replied on at Permalink Reply
campbell
I've experienced the same issues in the following browsers:

Chrome 20.0.1132.47 m
IE 8.0.7601.17514
Firefox 13.0.1
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
Text Removed
frz replied on at Permalink Reply
frz
I think you have two different things going on.

Most of the post is talking about our placeholders "CCM" stuff. We do that so versions on files works.

The actual error you're having sounds more like it's a file issue on your local box. Perhaps you are dealing with a newer excel file with an older version of excel? Latest Microsoft doc types are actually zip files with a bunch of XML in them. Concrete5 doesn't do anything with the contents of your files, we're not scanning them and rebuilding them or anything... This looks like you're just trying to open a newer excel file in an older office app.
campbell replied on at Permalink Reply
campbell
That was my first thought, so I had the tech send me the file in question so I could determine if it was an Excel glitch. It opened without any problems.

That's when I decided to test the issue with images, as well. I was unable to preview any image I had downloaded in Windows Photo Viewer, and was unable to open any ZIP archive. I have double-checked that I am able to view images and open ZIP files from other sources without any issues.

The one thing I have been able to view is PDF files. That is, if I click on the PDF in the File Manager and select Download from the menu that displays, it opens with no issues. If I select the checkbox next to the PDF file and select Download from the drop-down at the top of the File Manager, I still receive a ZIP archive that can't be opened.
companyou replied on at Permalink Reply
companyou
I'm actually running into the same problem.
The zip files send by concrete5 do not appear to be valid zip files.

Opening it with a texteditor i find out what the problem is:
It's an error!! (see below, edited to realative paths from concrete5 home).

When i remove line 99 in file.php i get the real error:
There is no file...
For some reason it doesn't create a file in the temp folder (even not with full (0777) permissions on it).

<br />
<b>Warning</b>: filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for /files/tmp/Z4gB56tKtP9Y.zip in <b>/concrete/core/helpers/file.php</b> on line <b>99</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>99</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>100</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>101</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>102</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>103</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>104</b><br />
<br />
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /concrete/core/helpers/file.php:99) in <b>/concrete/core/helpers/file.php</b> on line <b>105</b><br />
<br />
<b>Warning</b>: fopen(/files/tmp/Z4gB56tKtP9Y.zip) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory in <b>/concrete/core/helpers/file.php</b> on line <b>118</b><br />