Video upload

22 views
Skip to first unread message

Sean Miller

unread,
May 9, 2012, 7:24:03 AM5/9/12
to jpl...@googlegroups.com
I've given up trying to get MP4 files to work on Firefox, so am now
trying to upload FLV files instead (which appear to work on all
browsers, life is too short!)...

So all good... it works...

http://www.steveholbrook.co.uk/pages/site.php?pgid=239

BUT, I cannot get my PHP to upload the FLV files... the code is as
follows (in PHP) :-

$fileType = $_FILES['file']['type'];
$filename = "";

if ( $fileType == "application/msword" || $fileType ==
"application/pdf" || $fileType == "audio/mpeg" || $fileType == "x-flv"
) {
$filename = $_FILES['file']['name'];
copy ($_FILES['file']['tmp_name'], "../files/"
. $filename) or die("Failed to upload file");
}

For some reason on my .flv file $fileType is coming out blank... and,
yes, I have the multi-part encoding etc. on the form as it is working
fine with the audio and with the word/pdf files (it is a generic
upload routine).

Any ideas?

Sean

Sean Miller

unread,
May 12, 2012, 1:33:33 AM5/12/12
to jpl...@googlegroups.com
Anybody able to help with this ?

Martin Robertson

unread,
May 12, 2012, 5:33:28 AM5/12/12
to jpl...@googlegroups.com
for determining file_type, theres some good advice :

but if all you need todo is achieve an FLV fileupload & you can edit the PHP -
why not remove the IF check, or base it on file extension instead?

hth, m.

--
You received this message because you are subscribed to the Google Groups "jPlayer: HTML5 Audio & Video for jQuery" group.
To post to this group, send email to jpl...@googlegroups.com.
To unsubscribe from this group, send email to jplayer+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jplayer?hl=en.


Sean Miller

unread,
May 12, 2012, 5:34:49 AM5/12/12
to jpl...@googlegroups.com
On 12 May 2012 10:33, Martin Robertson <mansionhou...@gmail.com> wrote:
> but if all you need todo is achieve an FLV fileupload & you can edit the PHP
> -
> why not remove the IF check, or base it on file extension instead?

Yes, that was a thought. Just intrigued as to why the PHP function
for MIME isn't returning anything.

Sean

Martin Robertson

unread,
May 12, 2012, 5:49:54 AM5/12/12
to jpl...@googlegroups.com
PHP is simply reporting what the underlying OS returns :
presumably because the OS MIME magic doesnt recognise FLV ...

I gather its *nix of some sort ?

from the command line what do you see when you do :
file <filename.FLV>

exmaple from OSX :
file 0038496.flv 
0038496.flv: Macromedia Flash Video






Sean

Sean Miller

unread,
May 12, 2012, 5:54:10 AM5/12/12
to jpl...@googlegroups.com
[root@server2 files]# file test.flv
test.flv: Macromedia Flash Video
[root@server2 files]#


Sean

Martin Robertson

unread,
May 12, 2012, 5:57:06 AM5/12/12
to jpl...@googlegroups.com

Sean Miller

unread,
May 12, 2012, 6:13:52 AM5/12/12
to jpl...@googlegroups.com
On 12 May 2012 10:57, Martin Robertson <mansionhou...@gmail.com> wrote:
> cool - then one of the solutions on :
> http://stackoverflow.com/questions/310714/how-to-check-file-types-of-uploaded-files-in-php

Loads of food for thought there... thanks Martin!! :-)

Sean

Martin Robertson

unread,
May 14, 2012, 3:05:10 AM5/14/12
to jpl...@googlegroups.com
no worries, happy to help.  stackoverflow.com is an excellent resource :
there's plenty people there asking/answering questions.

as for why $_FILES['file']['type'] isnt populated ...
am guessing a php ini / config parameter?

mart.


Sean

Reply all
Reply to author
Forward
0 new messages