Hello ,

I would like to modify this script a bit . It is a video upload script for my site . The php content contains all the neccessary fields and upload via browse files only . I would like to make it another optional such as remote/url upload . There have to be 2 optional uploads , whether via browse file or url upload . The php script is below : -

{literal} 
    <script type="text/javascript"> 
    var video_allowed_extensions = /(avi|mpg|mov|asf|mpeg|xvid|divx|3gp|mkv|3gpp|mp4|rmvb|rm|dat|wmv|flv|ogg)$/i;     
    </script> 
    {/literal} 
    <script type="text/javascript" src="{$baseurl}/js/jquery.upload-0.1.php"></script> 
    <div id="content"> 
        {include file="memberside.tpl"} 
         
        <!-- RIGHT --> 
        <div class="right span-653"> 
            <div class="box"> 
                <div class="bsub">&nbsp;</div> 
                <div class="btitle"><h2>{$lang327|upper}</h2></div> 
                <div class="binfo font-12 font-bold"> 
                    {$lang328} 
                </div> 
                <br> 
                <div id="upload_video_form"> 
                <form name="uploadVideo" id="uploadVideo" method="post" enctype="multipart/form-data" target="_self" action="{$baseurl}/upload/video"> 
                 
                    <input type="hidden" name="MAX_FILE_SIZE" value="1048576000" /> 
                    <input type="hidden" name="UPLOAD_IDENTIFIER" id="UPLOAD_IDENTIFIER" value="{$upload_id}" /> 
                    <input type="hidden" name="video_upload_started" /> 
                     
                    <div class="separator"> 
                        <label for="upload_video_title">{$lang329}:</label> 
                        <input name="video_title" type="text" value="" id="upload_video_title" class="large" /><br /> 
                        <span id="video_title_error" class="error" style="display: none;">{$lang330}</span> 
                    </div> 
                     
                    <div class="separator"> 
                        <label for="upload_video_details">{$lang647}:</label> 
                        <textarea name="video_details" id="upload_video_details"></textarea><br /> 
                    </div> 
     
                    <div class="separator"> 
                        <label for="upload_video_keywords">{$lang17}:</label> 
                        <textarea name="video_keywords" id="upload_video_keywords"></textarea><br /> 
                        <span class="expl">{$lang331}</span><br /> 
                        <span id="video_tags_error" class="error" style="display: none;">{$lang332}</span> 
                    </div> 
                     
                    <div class="separator"> 
                        <label for="upload_video_paysite">{$lang333}:</label> 
                        <input name="video_paysite" type="text" value="" id="upload_video_paysite" class="large" /> 
                    </div> 
                     
                    <div class="separator"> 
                        <label for="upload_video_category">{$lang133}:</label> 
                        <select name="video_category" id="upload_video_category"> 
                        <option value="0" selected="selected">-----</option> 
                        {insert name=get_categories assign=cat} 
                        {section name=i loop=$cat} 
                        <option value="{$cat[i].CATID}">{$cat[i].name}</option> 
                        {/section} 
                        </select><br /> 
                        <span id="video_category_error" class="error" style="display: none;">{$lang334}</span> 
                    </div> 
                     
                    <div class="separator"> 
                        <label for="upload_video_file">{$lang142}:</label> 
                        <input name="video_file" type="file" id="upload_video_file" /><br /> 
                        <span id="video_file_error" class="error" style="display: none;">{$lang335}</span> 
                        <span id="video_file_ext_error" class="error" style="display: none;"></span> 
                    </div> 
                     
                    <br> 
                     
                    <div class="separator"> 
                        <label for="upload_video_anonymous_no">{$lang135}:</label> 
                        <input name="video_anonymous" type="radio" value="no" id="upload_video_anonymous_no" class="radio" checked="checked" /> 
                        <span class="radio">{$lang136}</span><br> 
                        <label for="upload_video_anonymous_yes">&nbsp;</label> 
                        <input name="video_anonymous" type="radio" value="yes" id="upload_video_anonymous_yes" class="radio" /> 
                        <span class="radio">{$lang137}</span> 
                    </div> 
                     
                    <div class="separator"> 
                        <label for="upload_video_privacy_public">{$lang336}:</label> 
                        <input name="video_privacy" type="radio" value="public" id="upload_video_privacy_public" class="radio" checked="checked" /> 
                        <span class="radio">{$lang337}</span><br> 
                        <label for="upload_video_privacy_private">&nbsp;</label> 
                        <input name="video_privacy" type="radio" value="private" id="upload_video_privacy_private" class="radio" /> 
                        <span class="radio">{$lang338}</span> 
                    </div> 
                     
                    <br> 
                    <div id="upload_loader" style="display: none;"> 
                        <img src="{$imageurl}/ajax-loader.gif"> 
                    </div> 
     
                    <div id="upload_status" style="display:none;"> 
                        <div id="upload_progress"><div class="bar" style="width: 0;">&nbsp;</div></div> 
                        <div class="upload_info"> 
                            <div id="upload_time"></div> 
                            <div id="upload_size"></div> 
                            <div class="clear"></div> 
                        </div> 
                    </div> 
                    <div id="upload_message" style="display: none;"></div> 
     
                    <div class="separator"> 
                        <label for="upload_video_submit">&nbsp;</label> 
                        <input name="submit_upload_video" type="button" id="upload_video_submit" value="{$lang339}" class="button" /> 
                    </div> 
                </form> 
                </div> 
                <br /> 
                <div class="binfo font-12 font-bold"> 
                   {$lang340}          
                </div> 
     
                <br /> 
            </div> 
        </div> 
        <!-- RIGHT END --> 
        <!-- rem div here --> 
        <div class="clear"></div> 
    </div>

Recommended Answers

All 8 Replies

Member Avatar for diafol

So let me get this right, you want to upload a video to your site from somebody else's?

And you want somebody here to write the code for you to do that? If so, this a gimme,gimme,gimme post. Please tell me that's not what you're looking for.

Hi ,

I'm actually want to add an extra option to upload video via url . My purpose is to let other users to upload video to my site easily . I just wanted someone that can modify the script a bit to add url upload as 2nd choice only . Anyone willing to help me here...???

Member Avatar for diafol

I'll give you a pointer:

Many methods to try, including:

cURL
file_get_contents
copy
sockets (fsockopen)

check out the php manual

Hi ,

Anyway thanks for your concern . But , could you be more specific ?

Member Avatar for diafol

All those methods will in theory allow you to get a file from a remote server. However, some domain hosts block certain commands, such as file_get_contents().

Here's a curl example:

$ch = curl_init(); 

curl_setopt($ch, CURLOPT_URL, "http://www.targetsite.com/thefile.ext"); 
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 

set_time_limit(120); //timeout at 2 minutes for php
curl_setopt($ch, CURLOPT_TIMEOUT, 120); // same for curl 

$destinationfile = fopen('/destinationsite.com/thefile.ext', 'wb'); 
curl_setopt($ch, CURLOPT_FILE, $destinationfile); 
curl_exec($ch); 

fclose($destinationfile); 
curl_close($ch);

This may cause your system to hang for a little while, so an ajax operation utilizing an animated 'throbber' may be useful. Otherwise the user may think the form processing has frozen.

Anyway, I'm sure you can find appropriate examples for the others if you Google / use the php manual.

Hi ,

I can find similar codes above and much more better than that . But , I don't know how to insert that code correctly into existing script code . For example , the existing script code requires file browser upload cumpulsory to be filled or I cannot press the submit button . Now , I'm trying make 2 options , whether to use via browser or remote upload . So , I need to remove the compulsory option for file browser upload first . Then , I still need to edit the existing script code as well .

Member Avatar for diafol

> I can find similar codes above and much more better than that

Sorry, if I'm wasting your time, but you did ask me to elucidate:

> But , could you be more specific

WRT the link, this asks the user to download, unpack and browse. I'm afraid that's going a bit far for a help forum. Bugging out, good luck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.