Jump to content


Photo

Problem uploading/viewing images greater than 8KB


  • Please log in to reply
2 replies to this topic

#1 JCTucker

JCTucker
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 March 2006 - 12:12 PM

Hello, first post. Working on a capstone project, and I've run into a bit of difficulty.

A user has the option to create a news story with an accompanying image for use in a "news capsule." However, when the image is larger than 8KB in size, it's apparently not being fully uploaded to the MySQL database. Everything I've looked at codewise has come with the caveat that "images can be no larger than 8KB in size." This has been mainly for users wanting to upload things like avatar images. I've put a MAX_FILE_SIZE field of 2MB, but that's not an issue. What I need to do is get around fread()'s inherent stopping once 8192 Bytes are read, since images don't have EOLs. This has to be doable, doesn't it? Because what's the advantage of storing images in a DB if you can't store anything bigger than an avatar?



#2 lpxxfaintxx

lpxxfaintxx
  • Members
  • PipPipPip
  • Advanced Member
  • 181 posts

Posted 23 March 2006 - 12:24 PM

Why would you store imges in the db? Why not just store the image's information in the db? I'll let you look at my source for uploading images. I've successfully uploaded more than 2 MB.

P.S. Are you from BWH?

#3 JCTucker

JCTucker
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 23 March 2006 - 12:35 PM

[!--quoteo(post=357562:date=Mar 23 2006, 07:24 AM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 23 2006, 07:24 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Why would you store imges in the db? Why not just store the image's information in the db? I'll let you look at my source for uploading images. I've successfully uploaded more than 2 MB.

P.S. Are you from BWH?
[/quote]

Well, I tried to show my code, but the site didn't like that. I couldn't use the code tag properly, so yeah... Everything is stored in the database to bypass permission problems that we can't manipulate on the school's server. Initially, we just had a "reference" field that would hold the relative path to the image file, but we couldn't get the image on the server. So, we decided to put it in a mediumblob in case it went over the 64K. 16MB seems safe enough, and we were told disk size isn't a concern...

We're building a CMS that's used when a local company wants their site updated. Unfortunately in the past, the group/class that built the site has graduated/moved on, and we all know how tough using another's source code can be. So, the CMS would, in theory, allow another group to make requested changes or even allow the end user to do the changes.


I'm not sure what BWH is, so I'll go with 'no.'




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users