Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
WebDwarf, SiteSpinner, SiteSpinner Pro 'How do I...'
How to have visitors to my site upload video ?|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Junior Mechanic |
Hello,
This forum has helped me alot through the years and this is my first post ever. I been searching and found similar posts but wasnt able to use the way I needed. I need to allow visitors (members) of my website to upload video and mp3 files to the site. I tried to mess with the forms section of tutorials about uploads but I am lost. I usually do alot of research and just figure it out eventually but I am stuck. I think I need step by step help. Thanks in advance! |
||
|
|
Honorary Mechanic |
.
If you would use Youtube as your Video-player you could have them upload to Youtube at their own individual account...they would then only have to upload the url to that video to your site or maybe better the complete embedding code that will then show the embedded player @ your website. This will solve many other problems also that you are going to encounter..such as converting the various formats,time/size limits a good uploading-system, avoiding x-rated video's ...etc, since that is all handled by Youtube Best of all it will cost you zero-$$ for the traffic/bandwidth which can be huge in case of videos. Similar providers exist for mp3 Radio . This message has been edited. Last edited by: radiotechscan, |
|||
|
|
Junior Mechanic |
The YouTube idea is a cool idea but I plan on putting my site logo in the corner of the videos to help promote for them and my website of course.
http://php.about.com/od/advanc.../php_file_upload.htm I came across this tutorial here but am confused on how to do it. It seems to be what I'm looking for. If someone can help me implement this with sitespinner I will be very grateful. |
|||
|
|
Guru 'Geezer' Mechanic |
Go to page 5 of the About PHP link you gave and copy the php code into a plain text editor (not a work processor) and save it. It must be a plain text file. Give it a file extension of .php and remember the file name - you will need it later. Then upload this file to your site's root directory. Use your site's file manager (or FTP program) to create a new sub-folder on your site named upload under your root directory.
In SiteSpinner, use a Form Upload box (bottom toolbar) and a Submit button. For the Action of the form enter the name of the php file you uploaded earlier. That's about all you need to do to upload a file. Be aware that most server implementations of PHP restrict a upload file to a max of 2.5MB (the script imposes a limit of 350KB; adjust it up to the max, allowed as needed). This may not be enough for a video file, but should be enough for an mp3 file. What do you plan to do with the files once they are uploaded? The upload script does not do anything more than upload the files and store them in the upload sub-folder. |
|||
|
|
Junior Mechanic |
I cant get it to work. The explanations sound good buy when I press submit then nothing happens. My host is Jumpline doing the 3 mos free trial. I am also using Filezilla to try to upload. The jumpline root is /httpdocs and I put the php.txt file inside the upload folder under /httpdocs/upload. Is this right? There is also a /httpsdocs folder in the remote site box. I'm guessing its not.
I plan on having members of my site to upload 2-6 min videos and audio. Then I will post them on my site through Sitespinner of course. After adding my logo to the vids. Thats the plan for the site. The members will be voting for their favorite. So the upload situation is the only thing holding me back right now. Any more suggestions please? Thanks in advance for your help. |
|||
|
Guru 'Power' Mechanic![]() |
The /httpdocs/upload folder will be only for the upload files. Other files will be in the root folder of your site, /httpdocs. This includes your php file, which should have a file extension of .php, not .txt as you imply.
|
|||
|
|
Guru 'Geezer' Mechanic |
Can you post a link to your page?
|
|||
|
|
Junior Mechanic |
I still havent been able to do this. I dont know if anyone else is using Jumpline as their host but thats who I am using. If anyone is familiar please give me the step by step. I tried to follow the directions from you vets but I cant get the upload link to do anything after I insert the file to be uploaded. So of course im doing something wrong.
Sorry it took so long to get back to this thread but I had some things that had to be taken care of...here the link of my site so far http://www.slaprap.com Also if someone can give me some pointers on adding a comment box for the videos that are battling next to the poll on the video page. Thanks |
|||
|
|
Guru 'Geezer' Mechanic |
Log into your Jumpline account and using the control panel, open the file manager and create at folder named upload under your root directory.
The following is the PHP upload script from about.com; enter it (or copy & paste) into a plain text editor. Save in as a local file called uploadfile.php and then upload it to your site's root directory. (I believe that the Jumpline control panel contains a FTP client that will let you do this if you do not already have an FTP program). <?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
//This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?> This script will allow any type of file (except php files) to be uploaded. If you want to restrict the type of file further, it can be changed (if you give me specifics). Also, the upload file size is limited to 350KB. Most PHP installation will allow a maximum upload size of 2MB, so you could change this if 350KB is too small for your purposes.In your SiteSpinner project page containing the upload form, make sure you use a file upload box so the visitor can specify a file to be uploaded. Do NOT use a normal text entry box as this does not (cannot) initiate a file upload when the Submit button is clicked. Only a file upload box can be used for this purpose. In this form, make sure you specify a form Action of uploadfile.php which is the name of the PHP script you have uploaded to your site. If you have placed the script in your root directory (or the same location where the form page will be), then you will not need to specify a path in the form Action. I did not see a link on your site to the upload form, so I cannot check to see if there are any other errors you may have. The PHP script listed above only uploads a file. It does not keep track of any additional info, such as who submitted the file, date submitted, comments, etc. The script can be expanded to include any additional info you want to collect via a form, but details will be needed to make the changes. Can you elaborate on what you want? If you want to add comments, wouldn't a text object work? Or do you mean you want to collect comments from your voters? Or display comments from the submitters? |
|||
|
|
Junior Mechanic |
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /> </form> I actually had this up for the submit and browse buttons on my site but took it down until i can get it to actually upload. Should I use this or add my own buttons and upload file box? ...as far as the comments go, I want the guests to be able comment on the voting, the videos and for the comments to be displayed all in one. |
|||
|
|
Guru 'Geezer' Mechanic |
That's going to be tough. I assume you want your visitors to add comments at the same time they vote for a video. You are using a flash polling system, which would be hard to modify. Does the 99polls web site allow you to build a polling system with comments? If not, then you would need to convert to a PHP polling system, add a system to keep track of comments (either a database or XML file) and alter your page to display the comments.
The form looks OK. Just make sure the file specified in the form's action is the same name as the PHP script. |
|||
|
|
Junior Mechanic |
I dont need the comments to be directly tied to the poll. It can be separate and they can comment about the polls if they want or whatever ...two separate actions.
and with the uploading...If I choose to do the file upload box from SS the only thing I add to the URL (action) right? Then what do I add for upload button URL (action)? And should that be it for that? |
|||
|
|
Guru 'Geezer' Mechanic |
You will need to name your form's file upload box uploaded (the Name field); the Value does not matter.
The form has only one action as specified on the Form Editor Form tab. Your button must be a Submit type in order to tigger the form action; any other button type will not trigger the form's action. The File Upload box and the Submit button should be connected to the same form by name. Do not use two different forms and the action will apply to both form elements. A PHP script that allows a visitor to add comments to a page can be found here. You will need to set up a MySQL database. I tested this a few years ago and it worked. |
|||
|
|
Junior Mechanic |
thanks my friend...I will try these methods and will let everyone know if it was a success.
|
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|
Virtual Mechanics: Community Forums and FAQs
Virtual Mechanics: Community Forums and FAQs
WebDwarf, SiteSpinner, SiteSpinner Pro 'How do I...'
How to have visitors to my site upload video ?
