| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| PNG Mime | |
|---|---|
| Tweet Topic Started: Apr 16 2005, 03:32 PM (547 Views) | |
| JCink | Apr 16 2005, 03:32 PM Post #1 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Okay, I am having a couple problems here. I'm developing photo software, and and uploader for just images for my main site and I need a little bit of help.
My test photos server got burned once by some guy that uploaded a PHP file. It wasn't blocked, so it let him in. Since then I have blocked all everything except for image files. One thing I miss is being able to upload PNG files - why won't this work? Is the type wrong? I try to upload several PNGs, created and saved with several different programs, and nothing. I can however, upload all of the other types, they work just fine. Also, someone told me it's dangerous to allow PNG files because they can be "Scripted" or something - that true? thanks for any help. |
![]() |
|
| JoeC | Apr 16 2005, 04:00 PM Post #2 |
|
Euch! IE tastes horrible!
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
It's true that scripts can be embedded into images, although I'm not entirely sure if it's only PNG or whether other formats can be scripted too. |
![]() |
|
| JCink | Apr 16 2005, 04:51 PM Post #3 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Okay. Thats what I thought too. What lead me to thinking that PNG is scripted is because I see a lot of GD library use with PNGs, like imagecreatefromPNG(); or something like that. Somewhere I saw that PNGs were the only types of images that can be scripted.... not sure. |
![]() |
|
| Seth | Apr 16 2005, 05:22 PM Post #4 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
PNG images are just images... no "scripting" or anything. I would check your server settings. That little code snippet is correct. |
![]() |
|
| JCink | Apr 16 2005, 05:58 PM Post #5 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I guess it must just be yahoo servers... but that must mean a lot of servers, because I can't get this to work on Lycos, or anywhere else I know of. Thanks anyway. At least I know that code is right.
|
![]() |
|
| EvilSteve | Apr 16 2005, 08:07 PM Post #6 |
|
Member
![]() ![]() ![]()
|
Hey JCink, PNG images cannot contain scripts. The only way you could get a virus from a PNG image or any other type of image is if you opened it with faulty software, and in that case it's not the image's fault. Some browsers upload PNG images with the MIME type "image/png" and other browsers upload PNG images with the MIME type "image/x-png", so you need to check for both:
Attachments in InvisionFree seem to have this same problem... ![]() |
![]() |
|
| JCink | Apr 16 2005, 10:02 PM Post #7 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Oh! Thanks for that. I will try it out and see if that works. Thats funny because somebody tried to upload a png file just yesterday to my forums and it didn't work. I have all the same problems too with the attachment system... And thanks for the info about the viruses and such in images. |
![]() |
|
| Seth | Apr 16 2005, 11:01 PM Post #8 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Oooh, EvilSteve is smart. |
![]() |
|
| Nemesis | Apr 16 2005, 11:46 PM Post #9 |
|
+o0 1337 |=0|- j00
![]() ![]() ![]() ![]() ![]() ![]()
|
Are you serious or joking? :unsure: |
![]() |
|
| Das | Apr 17 2005, 03:56 AM Post #10 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Serious |
![]() |
|
| Seth | Apr 17 2005, 02:50 PM Post #11 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Serious. That is a good catch. |
![]() |
|
| Das | Apr 17 2005, 06:03 PM Post #12 |
![]()
Smells of rich mahogany
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Well he was right so I knew what you meant. Wait, if that last post wasn't sarcasm disreguard this. |
![]() |
|
| EvilSteve | Apr 17 2005, 10:10 PM Post #13 |
|
Member
![]() ![]() ![]()
|
:$ |
![]() |
|
| Seth | Apr 17 2005, 11:21 PM Post #14 |
|
I has a pony
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
![]() I liek smart members ![]()
|
![]() |
|
| JCink | Apr 18 2005, 07:24 PM Post #15 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I still couldn't upload PNGs, just checked one last time before I added the code, but now I added the x-png mime type, and tried again and YES! It worked! THANKS a lot EvilSteve!
|
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
| Track Topic · E-mail Topic |
4:02 PM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)







4:02 PM Jul 11