phpBMS

Ticket #348 (closed defect: worksforme)

Opened 3 years ago

Last modified 9 months ago

Attachments are corrupted

Reported by: roseserveradmin+phpbms@… Owned by: brieb
Priority: minor Milestone: unknown
Component: phpbms Version: 0.96
Keywords: attachment corrupt Cc:

Description

I am able to attach files to sales orders and things, but when I download them, they are corrupted. I've used various types of files (jpg, png, pdf, etc.) and all are corrupted upon downloading. I am using apache, php 5, and mysql 5 on the server.

Attachments

servefile.php Download (3.2 KB) - added by ben.willard@… 2 years ago.
added stripslashes function to servefile.php so that the slashes which are added on insert or update are removed upon download

Change History

  Changed 2 years ago by ben.willard@…

I have the same problem, and it looks like the issue is that when the data goes in, it's run through addslashes or mysql_escape or something similar, but it's NOT un-escaped when it comes back out. This should be easy to fix, I'd think.

Changed 2 years ago by ben.willard@…

added stripslashes function to servefile.php so that the slashes which are added on insert or update are removed upon download

follow-up: ↓ 3   Changed 2 years ago by brieb

The vast majority of people using phpBMS do not have this problem, and while your patch would fix the problem for you, it would create the problem for most other users. What we need to do is isolate how and why those slashes are not present.

My guess is that there is a MySQL or php/MySQL setting or version which is causing the system to automatically escape slashes on most systems, but not on yours. If we can isolate the cause, we can test for it, and then stripslashes when appropriate.

in reply to: ↑ 2   Changed 2 years ago by ben.willard@…

Thanks for the amazingly fast response! It seemed like it would be too easy for a simple stripslashes to be the answer, and I'm glad to know that the problem is larger than that.

Thanks again for your time!

  Changed 2 years ago by brieb

  • status changed from new to closed
  • resolution set to worksforme

  Changed 9 months ago by Kaycie

That?s more than sneisble! That?s a great post!

Note: See TracTickets for help on using tickets.
Scanned by Orvant Copyright © 2010 Kreotek, LLC. All Rights reserved.