upload wmv file

See all posts Reply

upload wmv file new!
by batica, 17 years, 11 months ago
Hey, I've tryed to upload .wmv files but always get Error: Incorrect type of file. I add "video/wmv", line in the allowed file types array but it doesn't work. Any help?Reply
Re: upload wmv file new!
by colin, 17 years, 11 months ago
You can try one of the following. Let me know which one works for you, and I'll add it to the list.

.asf    video/x-ms-asf
.asx    video/x-ms-asf
.wma    audio/x-ms-wma
.wax    audio/x-ms-wax
.wmv    audio/x-ms-wmv
.wvx    video/x-ms-wvx
.wm     video/x-ms-wm
.wmx    video/x-ms-wmx
.wmz    application/x-ms-wmz
.wmd    application/x-ms-wmd
Reply
Re: upload wmv file new!
by batica, 17 years, 11 months ago
Hello colin, this is solution for me:

video/x-ms-wmv

Thanks for pointing me in right direction.Reply
Re: upload wmv file new!
by colin, 17 years, 11 months ago
Cool. I wil add it in the allowed MIME types list.Reply
Re: upload wmv file new!
by Irineu Jr, 15 years, 4 months ago
It still dosent work with me...

If I use mime check = false
system information
- class version : 0.26
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : pt_BR
source is an uploaded file
- upload OK
- file name OK
- MIME type detected as text/plain by mime_content_type()
- source variables
file_src_name : C4.wmv
file_src_name_body : C4
file_src_name_ext : wmv
file_src_pathname : /tmp/phppMbKma
file_src_mime : text/plain
file_src_size : 1318800 (max= 33554432)
file_src_error : 0
process file to ../img/Jobs/
- file size OK
- script C4.wmv renamed as C4.wmv.txt!
- file mime OK : text/plain
- new file name body : 22f5ceeb
- file name safe format
- destination variables
file_dst_path : ../img/Jobs/
file_dst_name_body : 22f5ceeb
file_dst_name_ext : wmv.txt
- no image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : 22f5ceeb.wmv.txt
file_dst_pathname : ../img/Jobs/22f5ceeb.wmv.txt
- 22f5ceeb.wmv.txt doesn't exist already
- no image processing wanted
- process OK


and if I use mimecheck = true and allowed = array('video/x-ms-wmv');
Incorrect type of file.system information
- class version : 0.26
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : pt_BR
source is an uploaded file
- upload OK
- file name OK
- MIME type detected as text/plain by mime_content_type()
- source variables
file_src_name : C4.wmv
file_src_name_body : C4
file_src_name_ext : wmv
file_src_pathname : /tmp/phpsj9uVa
file_src_mime : text/plain
file_src_size : 1318800 (max= 33554432)
file_src_error : 0
process file to ../img/Jobs/
- file size OK
- script C4.wmv renamed as C4.wmv.txt!


Why it understand text/plain if $_FILE["filename"]["type"] return video/x-ms-wmv!? o.O

Thanks for the help, and great class =)Reply
Re: upload wmv file new!
by colin, 15 years, 4 months ago
Can you try with this new version 0.28RC4?Reply
Re: upload wmv file new!
by Irineu Jr, 15 years, 4 months ago
Sure...

Without mime check!
system information
- class version : 0.28RC4
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME returned as video/x-ms-asf
MIME type detected as video/x-ms-asf by UNIX file() command
source variables
- You can use all these before calling process()
file_src_name : C4.wmv
file_src_name_body : C4
file_src_name_ext : wmv
file_src_pathname : /tmp/phpwgBjlU
file_src_mime : video/x-ms-asf
file_src_size : 1318800 (max= 33554432)
file_src_error : 0
process file to ../img/Jobs/
- file size OK
- file mime OK : video/x-ms-asf
- new file name body : 200907290403443d0254fbe965da0309db543722f5ceeb
- file name safe format
- destination variables
file_dst_path : ../img/Jobs/
file_dst_name_body : 200907290403443d0254fbe965da0309db543722f5ceeb
file_dst_name_ext : wmv
- no image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : 200907290403443d0254fbe965da0309db543722f5ceeb.wmv
file_dst_pathname : ../img/Jobs/200907290403443d0254fbe965da0309db543722f5ceeb.wmv
- 200907290403443d0254fbe965da0309db543722f5ceeb.wmv doesn't exist already
- no image processing wanted
- process OK


with $handle->allowed = array('video/x-ms-wmv', 'audio/mpeg3', 'audio/mpeg', 'image/*');
system information
- class version : 0.28RC4
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME returned as video/x-ms-asf
MIME type detected as video/x-ms-asf by UNIX file() command
source variables
- You can use all these before calling process()
file_src_name : C4.wmv
file_src_name_body : C4
file_src_name_ext : wmv
file_src_pathname : /tmp/phpiaUNL6
file_src_mime : video/x-ms-asf
file_src_size : 1318800 (max= 33554432)
file_src_error : 0
process file to ../img/Jobs/
- file size OK
- error: Incorrect type of file.


with $handle->allowed = array('video/x-ms-wmv', 'video/x-ms-asf', 'audio/mpeg3', 'audio/mpeg', 'image/*');

system information
- class version : 0.28RC4
- GD version : 2.0
- supported image types : png jpg gif bmp
- open_basedir : no restriction
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
MIME returned as video/x-ms-asf
MIME type detected as video/x-ms-asf by UNIX file() command
source variables
- You can use all these before calling process()
file_src_name : C4.wmv
file_src_name_body : C4
file_src_name_ext : wmv
file_src_pathname : /tmp/phpTIq3bl
file_src_mime : video/x-ms-asf
file_src_size : 1318800 (max= 33554432)
file_src_error : 0
process file to ../img/Jobs/
- file size OK
- file mime OK : video/x-ms-asf
- new file name body : 200907290410013d0254fbe965da0309db543722f5ceeb
- file name safe format
- destination variables
file_dst_path : ../img/Jobs/
file_dst_name_body : 200907290410013d0254fbe965da0309db543722f5ceeb
file_dst_name_ext : wmv
- no image operation, keep extension
- checking for auto_rename
- destination file details
file_dst_name : 200907290410013d0254fbe965da0309db543722f5ceeb.wmv
file_dst_pathname : ../img/Jobs/200907290410013d0254fbe965da0309db543722f5ceeb.wmv
- 200907290410013d0254fbe965da0309db543722f5ceeb.wmv doesn't exist already
- no image processing wanted
- process OK


Now it works fine... congratulation about you fast reply and this magnificent classReply
Re: upload wmv file new!
by colin, 15 years, 4 months ago
So it is all good?Reply
Re: upload wmv file new!
by Irineu Jr, 15 years, 4 months ago
yes.... i just had to replace 'video/x-ms-wmv' to 'video/x-ms-asf' when I try upload a wmv file.Reply