Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploaded zip files (and others) are corrupted #371

Closed
skiglades opened this issue Aug 1, 2013 · 7 comments
Closed

Uploaded zip files (and others) are corrupted #371

skiglades opened this issue Aug 1, 2013 · 7 comments

Comments

@skiglades
Copy link

Even though the .zip extension is an allowed upload type, any zip files uploaded and then downloaded are corrupted and I receive an error that they are "invalid".

Additional testing through adding allowed file extensions "crt" and "key" also results in corrupted files after downloading them.

[Thu Aug 01 08:40:44.922429 2013] [:error] [pid 920:tid 1044] [client :62451] PHP Warning: readfile(C:/wamp/www//TeamPass-master/files/607af87d56203754d05ed047eb571333): failed to open stream: No such file or directory in C:\wamp\www\TeamPass-master\sources\downloadFile.php on line 25, referer: https:///TeamPass-master/index.php?page=items
[Thu Aug 01 08:40:44.922429 2013] [:error] [pid 920:tid 1044] [client :62451] PHP Stack trace:, referer: https:///TeamPass-master/index.php?page=items
[Thu Aug 01 08:40:44.922429 2013] [:error] [pid 920:tid 1044] [client :62451] PHP 1. {main}() C:\wamp\www\TeamPass-master\sources\downloadFile.php:0, referer: https:///TeamPass-master/index.php?page=items
[Thu Aug 01 08:40:44.922429 2013] [:error] [pid 920:tid 1044] [client :62451] PHP 2. readfile() C:\wamp\www\TeamPass-master\sources\downloadFile.php:25, referer: https:///TeamPass-master/index.php?page=items

Version 2.1.17

@skiglades
Copy link
Author

Please let me know if you can re-create this without issues. I also have the ModSecurity firewall installed on the system and am verifying that the firewall isn't having a part in this issue.

@nilsteampassnet
Copy link
Owner

Can you check with (firebug for example if you are using Fifrefox) if you get an an error after clicking on button "start uploading files"?

@skiglades
Copy link
Author

No error after clicking "start uploading files".

Response: "{"jsonrpc" : "2.0", "result" : null, "id" : "id"}"

When downloading the attachment from the TeamPass item, also no error. Except when attempting to open the zip file in Windows, then I receive:

Response:
"Compressed (zipped) Folders Error

Windows cannot open the folder.

The Compressed (zipped) Folder 'C:\filename.zip' is invalid"

@skiglades
Copy link
Author

Also, I uploaded a .txt file containing the letter "a". The upload works fine and I'm able to save the item. However, when downloading the attachment, my .txt file contains the following content:

"

( ! ) Warning: readfile(C:///TeamPass-master/files/d6a54b942e0dfb9d0bee2c5e63d69dd4): failed to open stream: No such file or directory in C:\TeamPass-master\sources\downloadFile.php on line 25
Call Stack
#TimeMemoryFunctionLocation
10.0006269288{main}( )..\downloadFile.php:0
20.0011317424readfile ( )..\downloadFile.php:25
"

@skiglades
Copy link
Author

capture

@nilsteampassnet
Copy link
Owner

Thank you for those inputs !

How silly BUG ... in sources\downloadFile.php at line 25, I've included a wrong variable.
Instead of
$_SESSION['settings']['path_to_files_folder'],
it should be
$_SESSION['settings']['path_to_upload_folder']

Should be ok now!

@skiglades
Copy link
Author

No problem, thanks for the fix! It works fine now.

nilsteampassnet added a commit that referenced this issue Aug 6, 2013
#371 - Fix for uploaded files corrupted
nilsteampassnet added a commit that referenced this issue Aug 15, 2013
#315 - jstree style.css badly referenced
#314 - Folder is not being deleted
#320 - Enabling LDAP prevents local admin login
#317 - server expected extensions are tested
#318 - Upgrade process badly creates sk.php file
#348 - Fix for undefined index "isAdministratedByRole"
#350 - Fix for Lock and delete user actions don't refresh page
#354 - Fix for removing folders
#359 - Fix for initial user password change complexity check
#371 - Fix for uploaded files corrupted
#291 - Fix to support openLDAP / posix style LDAP
#361 - Option to use login password as SALT key
* Fix - no possibility to update a Role
* Fix - editing users by clicking on the fields broken
* Fix - parse error in database errors log
* New - requested user password complexity shown when changing password
* New - option for deactivate client-server encryption (usage of SSL)
* New - in tree, new counters added (subfolders and items in subfolders
numbers)
* New language added - Catalan
nilsteampassnet added a commit that referenced this issue Aug 27, 2013
#315 - jstree style.css badly referenced
#314 - Folder is not being deleted
#320 - Enabling LDAP prevents local admin login
#317 - server expected extensions are tested
#318 - Upgrade process badly creates sk.php file
#348 - Fix for undefined index "isAdministratedByRole"
#350 - Fix for Lock and delete user actions don't refresh page
#354 - Fix for removing folders
#359 - Fix for initial user password change complexity check
#371 - Fix for uploaded files corrupted
#291 - Fix to support openLDAP / posix style LDAP
#361 - Option to use login password as SALT key
* Fix - no possibility to update a Role
* Fix - editing users by clicking on the fields broken
* Fix - parse error in database errors log
* New - requested user password complexity shown when changing password
* New - option for deactivate client-server encryption (usage of SSL)
* New - in tree, new counters added (subfolders and items in subfolders
numbers)
* New language added - Catalan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants