JCTucker Posted March 23, 2006 Share Posted March 23, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/5582-problem-uploadingviewing-images-greater-than-8kb/ Share on other sites More sharing options...
lpxxfaintxx Posted March 23, 2006 Share Posted March 23, 2006 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 Link to comment https://forums.phpfreaks.com/topic/5582-problem-uploadingviewing-images-greater-than-8kb/#findComment-19915 Share on other sites More sharing options...
JCTucker Posted March 23, 2006 Author Share Posted March 23, 2006 [!--quoteo(post=357562:date=Mar 23 2006, 07:24 AM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 23 2006, 07:24 AM) [snapback]357562[/snapback][/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.' Quote Link to comment https://forums.phpfreaks.com/topic/5582-problem-uploadingviewing-images-greater-than-8kb/#findComment-19919 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.