Forum

Thread tagged as: Question

How to upload video file

Hi Here I am trying to make functionality upload video for my website. can we upload video using perch. Please help me with this.

Damian McCracken

Damian McCracken 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, just like any other file. However as videos are large you will need to have high enough upload limits on your hosting.

Thanks But I am uploading 429 KB video and this is not added in asset.

Rachel Andrew

Rachel Andrew 394 points
Perch Support

If you think there is a problem then as usual we would need to see your template and Diagnostics Report.

We can't help you troubleshoot unless you give us enough information to do so.

Diagnostics Report

HEALTH CHECK
•   Setup folder is present and should be deleted
•   Perch is out of date. You are running Perch 2.8.32 and the latest is 2.8.34.Update instructions
•   PHP 7.0.9 is up to date
•   MySQL 5.5.5-10.1.19-MariaDB is up to date
•   Image processing available
•   File upload size is low. You can only upload files up to 2M.
SUMMARY INFORMATION
•   Perch: 2.8.32, PHP: 7.0.9, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
•   Server OS: WINNT, cli-server
•   Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_forms (1.8.3), ABC_languages (2.1), ABC_subsite (2.1)
•   App runtimes: <?php $apps_list = array( 'content', 'perch_forms', 'categories', );
•   PERCH_LOGINPATH: /perch
•   PERCH_PATH: E:\tfs\ABCosterInc\Development\perch
•   PERCH_CORE: E:\tfs\ABCosterInc\Development\perch\core
•   PERCH_RESFILEPATH: E:\tfs\ABCosterInc\Development\perch\resources
•   Image manipulation: GD
•   PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
•   F1: 2edba60ed1f613d6dd804feb202456a2
•   Resource folder writeable: Yes
•   DOCUMENT_ROOT: E:\tfs\ABCosterInc\Development
•   REQUEST_URI: /perch/core/settings/diagnostics/
•   SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
•   HTTP_HOST: localhost:31634

And this is my template page code

<perch:content id="file" type="file" accept="pdf,zip,video" />

I also update the

post_max_size=100M

in php.ini

Drew McLellan

Drew McLellan 2638 points
Perch Support

Are pdf,zip,video sections defined in your filetypes.ini file?

This is my filetype.ini file

[webimage]
image/gif
image/jpeg
image/jpg
image/png
image/svg+xml
image/webp

[image]
image/*

[pdf] 
application/pdf

[text]
application/plain
text/plain

[richtext]
application/rtf
application/x-rtf
text/richtext
text/rtf

[xml]
application/x-latex
application/xml
text/xml

[zip]
application/rar
application/x-bzip
application/x-bzip2
application/x-compressed
application/x-gzip
application/x-rar
application/x-rar-compressed
application/x-sit
application/x-stuffit
application/x-zip
application/x-zip-compressed
application/zip
multipart/x-gzip
multipart/x-zip
application/gnutar

[audio]
application/x-midi
audio/*

[video]
application/x-troff-msvideo
video/*

[flash]
application/x-shockwave-flash

[office] 
application/arj
application/excel
application/mspowerpoint
application/msword
application/onenote
application/powerpoint
application/vnd.ms-excel
application/vnd.ms-excel.addin.macroEnabled.12
application/vnd.ms-excel.sheet.binary.macroEnabled.12
application/vnd.ms-excel.sheet.macroEnabled.12
application/vnd.ms-excel.template.macroEnabled.12
application/vnd.ms-office
application/vnd.ms-officetheme
application/vnd.ms-powerpoint
application/vnd.ms-powerpoint.addin.macroEnabled.12
application/vnd.ms-powerpoint.presentation.macroEnabled.12
application/vnd.ms-powerpoint.slide.macroEnabled.12
application/vnd.ms-powerpoint.slideshow.macroEnabled.12
application/vnd.ms-powerpoint.template.macroEnabled.12
application/vnd.ms-word
application/vnd.ms-word.document.macroEnabled.12
application/vnd.ms-word.template.macroEnabled.12
application/vnd.oasis.opendocument.chart
application/vnd.oasis.opendocument.database
application/vnd.oasis.opendocument.formula
application/vnd.oasis.opendocument.graphics
application/vnd.oasis.opendocument.graphics-template
application/vnd.oasis.opendocument.image
application/vnd.oasis.opendocument.presentation
application/vnd.oasis.opendocument.presentation-template
application/vnd.oasis.opendocument.spreadsheet
application/vnd.oasis.opendocument.spreadsheet-template
application/vnd.oasis.opendocument.text
application/vnd.oasis.opendocument.text-master
application/vnd.oasis.opendocument.text-template
application/vnd.oasis.opendocument.text-web
application/vnd.openofficeorg.extension
application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.openxmlformats-officedocument.presentationml.slide
application/vnd.openxmlformats-officedocument.presentationml.slideshow
application/vnd.openxmlformats-officedocument.presentationml.template
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.openxmlformats-officedocument.spreadsheetml.template
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/vnd.openxmlformats-officedocument.wordprocessingml.template
application/wordperfect
application/x-excel
application/x-msexcel

Is there any solution for this.

Ben Furfie

Ben Furfie 3 points
Registered Developer

What happens when you attempt to upload a video? Is it refreshing and the file isn't in the assets list, or is it not even uploading? If it does appear to be uploading, have you checked your resources folder to see if the file is there?

Yes, when I am uploading the video file. the file is not appearing in the assets list and I also checked it in resources folder. But the file is not in the folder. until it will not appear in the list we can not select the video from the list. Is there any solution for this?

Ben Furfie

Ben Furfie 3 points
Registered Developer

Can you post the <perch:content> tag that adds the upload field?

This is the <perch:content> tag that i am using.

<video id="video" preload="true" poster="../../../img/transparent_vdo.png" autoplay loop muted>
    <source src="<perch:content id=" video-backgraund" type="file" label="Full version video path" />" type="video/mp4" bucket="video"/>
</video>

Is there any way. to get the solution?

Ben Furfie

Ben Furfie 3 points
Registered Developer

Is that the exact code?

If so, is this what you are experiencing?

  • You click on Select or upload a file.
  • The window slides out.
  • It has the No matching assets found note.
  • You click the Add Asset button.
  • You drop the file onto the upload box or select it from the explorer/finder window.
  • You then select the file and try to click Use Selected but nothing happens?

If so, it's because there is a space at the start of your ID video-backgraund.

Remove that and it should allow it to save and allow you to use it.

Duncan Revell

Duncan Revell 78 points
Registered Developer

Also, id requires the use of underscores, not dashes, so change the id to video_backgraund, just to be sure.

Drew McLellan

Drew McLellan 2638 points
Perch Support

And remove the space in the id.

Yes, I have made changes in the template page according to your suggestions. Unfortunately, still the problem is not sorted. Below is my template page code:

<video id="video" preload="true" poster="../../../img/transparent_vdo.png" autoplay loop muted>
    <source src="<perch:content id="video_backgraund" type="file" label="Full version video path"/>" type="video/mp4" bucket="video"/>
</video>

Hereby, providing all the screenshots of the running project with the issue I'm facing:

Quick screen-cast shows the issue:

Step_1

Step_2

Step_3

Step_4

Step_5

Step_6

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do the videos appear in the Assets app? I see you've filtered by 'Documents' when they'd be classed as videos.

No, the videos are not appearing in the Assets app.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do they appear on disk?

No, they are not appear on disk.