Php, mime types, image/jpeg

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Watch

adam_uk

Established Member
Impact
20
hey guys

got a small problem building a image upload script and im doing the validation

basically got problems with mime types

image/png works
image/gif works

but when i upload a jpg and echo $_FILES['img']['type'] i get nothing, ive copied the example from php to see if it was my dogey coding but its not

its really doing my head in

anyone know why php doesnt pickup image/jpg from the mime type

im using php 4.3.something with apache 1

thanks
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
the mime type could be image/pjpeg

strange that it will not echo the mime type tho, are you sure it is uploading ok

also I assume img is the actual name of the field in the form
 
0
•••
ive found some more information on this

it works with some jpegs, but not some others

ive added is_uploaded to the script just to secure it and if i upload one jpeg it wont upload, but if upload another jpeg it will upload

for example
i have an image called 3-00361.jpg this image doesnt upload

but this next image called e-3.jpg does upload
 
0
•••
adam_uk said:
ive found some more information on this

it works with some jpegs, but not some others

ive added is_uploaded to the script just to secure it and if i upload one jpeg it wont upload, but if upload another jpeg it will upload

for example
i have an image called 3-00361.jpg this image doesnt upload

but this next image called e-3.jpg does upload

I doubt the name is the problem because php gives it a temporary name anyway.
 
0
•••
Truehost — .com domains from $4.99, hosting includedTruehost — .com domains from $4.99, hosting included

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back