Posts [ 41 to 56 of 56 ]

Re: Beginners: File uploads and rendering images to the database

Thanks for the idea jnylund. I implemented it, however, I'm getting the same result. The page displays as expected, however, the picture is replaced with the "alt" empty box for the jpeg.

I have checked the actual db using the mySQLQueryBrowser from the mySQL people. The picture renders properly using that tool and everything else in the database looks just fine. And yes, the "id" sent is correct, so I'm looking at the right record.

I've attached the output from my latest debug run. Anyone have any ideas?

Re: Beginners: File uploads and rendering images to the database

I did just notice that the last line above returns a 200 status, however the URL is [http://localhost/pictures/code_picture?id=3] rather than [http://localhost:3000/pictures/code_picture?id=3] *the port number changed*.... Is this significant?

Re: Beginners: File uploads and rendering images to the database

!!! SOLUTION FOUND !!!

In frustration, rather than just sound reasoning, I was stepping deeply in to the code looking for anything at all. I finally noticed that the binary blob size was only 64K when in fact the filesize was over 190Kb. I then figured that there was no appropriate EOF in the file (or whatever JPG uses).

Long story short...

I migrated my database (mySQL) to use a :LIMIT of 4.megabytes.

I then stepped through the code to load a new image, and VOILA! The image was as expected.

Re: Beginners: File uploads and rendering images to the database

Final note (I hope)

With higher resolution cameras, and thus larger files, changing just the :limit value may not be enough. mySQL has a default packet limitation (the size of a single, entire query) of 1Mb. A simple change to the mySQL configuration file changes the client side value. I changed mine to 8Mb and everything worked again for larger pictures.

Re: Beginners: File uploads and rendering images to the database

When in list view, the photos show up at the top under the heading, then the line by line descriptive columns and contents show up under them.How do I get the photo images to be located in the column I want them in , and in my case, as the first item in the column list as displayed line by line?

Re: Beginners: File uploads and rendering images to the database

hi all I am a newbie to RoR , i have tried out this tutorial but got stuck.the "ruby script/generate scaffold photo photo_admin" didn't create any method in my photo_admin contoller. i'm using rails 2.0. Is there any sintax difference in rails 2.0

pls tell me what "ruby script/generate scaffold photo photo_admin" does ? will it create two controllers -> photo and photo_admin??!!