From: Jehan-Guillaume (i. de R. <io...@fr...> - 2013-01-24 16:38:30
|
On 24/01/2013 16:45, Robert Treat wrote: > On Thu, Jan 24, 2013 at 8:48 AM, Jehan-Guillaume (ioguix) de > Rorthais <io...@fr...> wrote: >> On 24/01/2013 14:32, Karl O. Pinc wrote: >>> On 01/23/2013 11:03:50 PM, Robert Treat wrote: >>>> I spoke with ioguix a few days ago on irc about releasing a >>>> new version of PPA, and that I had hoped to take another >>>> crack at solving the bytea problem. >>> >>> >>>> Thoughts? >>> >>> I'm going to have to pay attention to make sense, but this is >>> what's at the top of my head. >>> >>> What makes bytea so special that it's corrupted? >>> >>> Why do we not display bytea as hex, and have it be edited as >>> hex? (Why would hex cause corruption?) Pg shows bytea as hex, >>> for a reason: there's no way to tell what's encoded as bytea. >> >> If there's no HTML/js escaping messing needed with hex format, >> I'm 100% ok with this solution. That was my feeling as expressed >> in my previous mail : « Did you try with both bytea format ? » >> > > To answer Jehan's question, I did try both bytea formats, and tried > on multiple versions of Postgres, but was unable to get it to > work. Please don't let that stop you from trying again though, > it's certainly possible I was doing it wrong. > >>> If bytea is to be displayed as something other than hex that >>> should happen in javascript on the client. >> >> Mh, you're talking about showing the content of the binary, ie. >> an image ? We're far from this consideration imo. >> > > right. we only want to show the hex output, not show actual > images. (also, consider the use case of things like hex passcodes > or similar; bytea isn't always an image). > > I think where the issue comes up is that when you submit the form, > there is some escaping that occurs for http purposes. PHP is > supposed to give you the tools to deal with that, and postgres is > also supposed to give you some tools for that, just that I couldn't > figure out a working combo. The form piece is significant; ISTR > that I was able to get a script to do the select, escape, unescape, > and update (where I just put back the same value) to work > successfully, it was when adding in the step of displaying via form > and then submitting that it falls apart. Could you give us this script ? It would be a good scenario/starting point to work on this issue with you. > And not to be pessimistic, but I was very surprised I could find > no example PHP application that did this. Plenty of example for > reading a a file from disk and inserting it, and plenty for pulling > bytea and displaying it, but no for retrieving from db and the > updating from a form. :-\ > > > Robert Treat play: xzilla.net work: omniti.com |