PowerDrift Posted January 18, 2006 Share Posted January 18, 2006 I'm having this problem when I upload binary data to a MySQL table. When I upload an image, the results is a corrupted image (which can be seen here: [a href=\"http://americanmachineryhawaii.com/agriculture/equipmentdb/index.php?id=10036)\" target=\"_blank\"]http://americanmachineryhawaii.com/agricul...x.php?id=10036)[/a]. The weird this is that I uploaded this image before I uploaded the image that was supposed to be shown (instead of the corrupted file). Do you know what is causing this and how to fix it? I have tried dropping the table and recreating it, and dropping the database and recreating it. I also tried "FLUSH", but nothing happened. Quote Link to comment https://forums.phpfreaks.com/topic/3219-uploading-binary-outputting-corrupted-data/ Share on other sites More sharing options...
fenway Posted January 18, 2006 Share Posted January 18, 2006 Well, first, it has nothing to do with the table or the database. You've obviously managed to corrupt the binary data itself, though not terribly, because it still looks image-like. My guess is that you used the addslashes() function which can destory binary uploads. Post _just_ the relevant section of your PHP script that actually processes the image upload and inserts the data into your table. Quote Link to comment https://forums.phpfreaks.com/topic/3219-uploading-binary-outputting-corrupted-data/#findComment-10977 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.