SVG Images

See all posts See thread Reply

Re: SVG Images new!
by Dave Buchholz, 5 years, 8 months ago
Ignore that last set of logs here are the correct ones, have 2 test files and chose the wrong one!

print_r($_FILES) = Array
(
[src] => Array
(
[name] => cogs.svg
[type] => image/svg+xml
[tmp_name] => /usr/tmp/phpr4j7ar
[error] => 0
[size] => 3385
)

)

Logs:
system information
- class version : 0.35dev
- operating system : FreeBSD
- PHP version : 5.6.36
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- upload_max_filesize : 50M (52428800 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Fileinfo PECL extension deactivated
- Checking MIME type with UNIX file() command
    MIME type detected as image/svg; charset=us-ascii by UNIX file() command
- MIME validated as image/svg
source variables
- You can use all these before calling process()
    file_src_name : cogs.svg
    file_src_name_body : cogs
    file_src_name_ext : svg
    file_src_pathname : /usr/tmp/phpr4j7ar
    file_src_mime : image/svg
    file_src_size : 3385 (max= 52428800)
    file_src_error : 0
process file to ../../uploads/slides/kitchen-test/
- file size OK
- file mime OK : image/svg
- file name safe format
- destination variables
    file_dst_path : ../../uploads/slides/kitchen-test/
    file_dst_name_body : cogs
    file_dst_name_ext : svg
- checking for auto_rename
- destination file details
    file_dst_name : cogs.svg
    file_dst_pathname : ../../uploads/slides/kitchen-test/cogs.svg
- cogs.svg doesn't exist already
- ../../uploads/slides/kitchen-test/ doesn't exist. Attempting creation: failed
- error: Destination directory can't be created. Can't carry on a process.Reply
Re: SVG Images new!
by colin, 5 years, 8 months ago
The MIME type in $_FILES is sent by the client, and cannot be trusted. It is used only if all the server-side MIME detections fail.Reply
Re: SVG Images new!
by Dave Buchholz, 5 years, 8 months ago
ok, that makes sense

thanksReply