Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How would this be done in PHP?
Old 11-25-2007, 09:06 PM How would this be done in PHP?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Okay I am trying to do this in php

Upload a video make sure the extension is in a text file of acceptable extensions.
if it fails exit
or
if successful continue

convert the video using php's exec and ffmpeg
if it fails
exit or
if it is successful continue
write the data to mysql
if it fails
exit or
if it is successful show success
this is my model


>>Upload
>>>Is there an error? If so stop. If not continue
>>Convert
>>>Is there an error? If so stop. If not continue
>>Write to mysql
>>>Is there an error? If so stop. If not continue
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE


Last edited by goheadtry; 11-25-2007 at 09:08 PM..
goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
 
Register now for full access!
Old 11-26-2007, 12:26 AM Re: How would this be done in PHP?
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
For on how to upload see here http://us.php.net/features.file-upload
For how to confirm it's the correct file type:
<?php
function image_valid($type)
{
$file_types = array(
'image/pjpeg' => 'jpg',
'image/jpeg' => 'jpg',
'image/jpeg' => 'jpeg',
'image/gif' => 'gif',
'image/X-PNG' => 'png',
'image/PNG' => 'png',
'image/png' => 'png',
'image/x-png' => 'png',
'image/JPG' => 'jpg',
'image/GIF' => 'gif',
'image/bmp' => 'bmp',
'image/bmp' => 'BMP',
);

if(!array_key_exists($type, $file_types))
{
return "FALSE";
}
else
{
return "TRUE";
}
}

if(image_valid($_FILES['user_file']['type']) === "FALSE")
{
die("Image file is not valid");
}
?>
Just replace the correct video/BLANK
I don't know about file converting, but this should allow you to upload.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-27-2007, 05:00 AM Re: How would this be done in PHP?
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
What exactly you cannot perform?
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to How would this be done in PHP?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.87466 seconds with 12 queries