Would it be possible to allow a user to upload a video rather than just enter a path to a video? I'm interested in allowing users to post video (to a certain extent) and this module does pretty much everything I need except for the upload part.....

CommentFileSizeAuthor
#5 video_1.module28.04 KBfax8
#4 video_0.module28.04 KBfax8

Comments

fax8’s picture

Assigned: Unassigned » fax8

I agree with you.
I will work on it...

This is the first time I use file apis with drupal if someone wants to
help please write me (fvaresano [at] yahoo dot it)

fbomb’s picture

nice! let me know if you need any help......

garm’s picture

same here, was the first thing i missed when looking into this module so let us know if you need some help implementing it.

fax8’s picture

StatusFileSize
new28.04 KB
fax8’s picture

StatusFileSize
new28.04 KB

I'm getting problems with file upload...

attached is my last version.

I've added a file selection button and wrote down some functions
but I didn't be able to get the file be uploaded.

It seem that the uploaded file is complity ignored by drupal!

I didn't understood why this doesn't work...
I follow how image.module do but it didn't work...

Does someone has ideas???

p.s.:
be careful of debugging print() and die()

averageyoungman’s picture

Could the upload issue be related to the settings for the upload module in administer->settings->uploads?

I have four different Drupal installations, and every time I attempt to upload a file that is over about 2mb Drupal seems to lose track of the attachment. This is regardless of the size limitation I enter in those settings. From what I can gather based on forum threads, the problem lies in one of - or all of these - three places:

1.) The settings for "Maximum Total Filesize" for upload.module, which appear to need to be set to 0 or a high number in order to work. The description beneath that field is confusing, as it referes to "a user", but in reality is the setting for the COMBINED TOTAL OF ALL FILES UPLOADED WITH DRUPAL.

2.) A supposed bug in upload.module. You can find the info on that here: http://drupal.org/node/22033 or here http://drupal.org/node/21429.

3.) Depending on your Drupal version, the Apache directives for file sizes or two settings in settings.php related to upload file sizes. Here's a reference: http://drupal.org/node/19326

I haven't tested all of these but i am about to. I will respond with what I find out.

Thanks,

--aym

averageyoungman’s picture

So I'm testing it, and it seems like upload.module wants to save the file, but I am getting an error that reads:

File copy failed: no directory configured, or it could not be accessed.

I think this problem may be due to the fact that there is no function in video.module that creates a record of the file in the files table. If you look in image.module around line 727, you will find a function called:

function _image_insert($nid, $label, $image)

This function is called via the hook image_insert() and is responsible for inserting the file data into the files table.

I am going over the sequencing because I don't fully understand it, but I will report back my findings. I can't say for sure that this is the prroblem, but it seems likely.

--aym

averageyoungman’s picture

OK. So I think I may have solved one of the problems. In your install test file, you don't make mention of the fact that both the "videos" and "temp"directory are required, where the "temp" directory should be within the "videos" directory. Having both these directories in place inside the files directory will at least get the file uploaded to temp.

I believe the files then need to be copied from the temp directory into the main video directory. like I said in an earlier post on this thread, this seems to be accomplished in image.module with the function _image_insert() (with preceeding underscore).

I will report back as - and if - I make progress on that front.

Concerning the other issue of Drupal not uploading files over 2mb, I seem to have made some headway on that one. Via the links in my other posts in this thread, i have successfully uploaded a quicktile move that is 3.6mb. I can't confirm that these settings will work for everyone, but maybe they will. Here's what to do to set it up like I have it set up. this is for 4.6 or 4.6.2

1.) Go to this thread: http://drupal.org/node/22033 and alter upload.module as described there.

2.) Make sure that "Maximum Total File Size" in administer->settings->uploads is either set to 0 or a number that won't break upload.module when it goes to upload files. Specific settings can be applied on a role basis.

3.) in settings.php, add the following two lines:
ini_set('post_max_size', '5M');
ini_set('upload_max_filesize', '5M');

and adjust the '5m' to whatever you want for the maximum filesize for one upload.

You may also need to add the appropriate ffile extensions for the types of video you want to be able to upload in adminsiter->settings->uploads. For me it was mov and wmv.

This combination of things has allowed me to get to where I described above.

--aym

kerrizor’s picture

I can upload files via upload.module.. is it worth my time to modify video.module so that it looks to see if there's an uploaded file associated with the node it and then using that local URL as its path for play/download? That seems to be the quick and dirty solution here.

fax8’s picture

there is a clean way of doing something like this.
Image.module associate uploaded images and all the other generated formats (thumb, 640x640, ecc.)
to a node putting that file available on the upload.module stuff
(uploaded images shows up into uploaded files at the bottom of the page).

Something like this should be wonderful.

kerrizor’s picture

fax8, that's pretty much what I'm doing with it now, I just want it more integrated, so that the uploaded video /is/ the content, rather than being displayed as an attatchment.. but that's a minor change in some ways.

LukeLast’s picture

Do you know how to keep the attachment list from showing up on the node? This seems to be the only problem with just using the upload modules attachment feature. I mean upload module already works great with spiffy AJAX functionality and whatnot.

I would envision the ultimate version of this module to allow for multiple video uploads allowing meta data to either be grabbed with ID3 or entered manually for each video as well as images and thumbnails along with it. And using all these videos to allow for multiple playback and downloading.

kerrizor’s picture

The submission form would need to be modified, so that the URL would get auto-filled with the final location of the file, and... would it be node.module?

Oh oh oh oh... SUPER ideal? Allow users to upload video /and/ a thumbnail image, use the thumbnail image for the first view of the node... but I'm a dreamer.

I'd do it myself, except A) I'm in no way familiar enough with the guts of video.mod or node.mod OR upload.mod to attempt this and B) too busy getting the rest of Drupal to work (just like everyone else, I imagine)

LukeLast’s picture

I guess I can try it out and see how it works.

BTW, my video site uses images by way of a non video.module changing hack, (www.ppixel.com). I would like to add this feature into the module someday using image.module with fax8's permission, but that should be a seperate discussion.

fax8’s picture

I always like small and modulerized software: clean, fast and more easy to understand.

This is why I didn't implement the screenshot function yet.
See: http://drupal.org/node/25230#comment-46459

What do you think about it?

fax8’s picture

Marking http://drupal.org/node/57824 as duplicate of this feature request.

fax8’s picture

Marking http://drupal.org/node/60564 as duplicate of this feature request.

maastrix’s picture

Any news on how to enable this on drupal 4.7?

blockcipher’s picture

fax8,

I'm no programmer but couldn't you take out the code from the audio.module that does allow upload and try to get it to work with your module? Possilby all the code is there already for you to work with?

Just an idea.

Thanks for the great module. Once I can allow uploading via your module I can work on my site.

Thanks!

sakdrupal’s picture

I cant seem to attach a small image with my video upload. I could get my video to upload but i cant attach an image. The other thing is that how can i create a view to display the node type video - is there any way to create a view that show this node and some other contents from another node

sk

pancapangrawit’s picture

Hi,

the audio-module is just being extended by two great contrib-modules: one allows for mass-uploads and the second one for attaching audio-files to any content-type (like image-attach). Would be lovely for video too. Maybe some code can be reused?

Thanks & Best
Rainer

robloach’s picture

You can just use the upload.module to upload your video and then type in the new address of that uploaded video into the Video Link. Works perfectly.

pancapangrawit’s picture

hmm, true. But if I understand correctly its a bit complicated. You first create a page- or article-node and then the video-node. Can you delete the page-node afterwards?
My request is certainly not of high priority - just to give users a simple one-step way to go create a video-node.
And: with a seperate video-upload module you could distinguish video-upload rights from general upload rights.

Best
Rainer

fax8’s picture

I just get a sponsor for this.
My deadline for this feature will be in 3 weeks.

Fabio

pancapangrawit’s picture

Cool :D Congratulations!

robloach’s picture

pancapangrawit: No, with the upload.module, you can upload files directly to the node that you're using as the new video. So, in essence all you do is go:

  1. Create content, video...
  2. Go down to the bottom of the page to the attachments section and upload your video using the AJAX upload feature.
  3. Untick the "list" option so that the attached video doesn't show up in the node itself.
  4. Copy the given URL of the newly attached video file and put it in the URL field of the video.
  5. Save the page.

Now you have the video working perfectly through the video module and the actual video file appears as an attachment to the node when you're editing it. Works very nicely....

pancapangrawit’s picture

Rob: thanks a lot for the detailed description. It does work and that certainly helps - although a bit confusing too, isn't it - because it depends on the fact that the upload-module does actually upload before the video-module effectively creates the node. This is in a way also problematic because people could potentially upload files without the node ultimately being created. Probably upload shouldn't actually occure before the node has been created. But the way it is we end up with a nice workaround :-). One thing though: you cannot specify a path and as I said upload rights depend on the general upload site-policy.

Therefore it would still be nice to have a clean upload functionality integrated into the module. It would ideally also integrate an option to upload thumbnails and support uploads for the "multi-video-download"-fuctionality in one step.

I guess there is not much hope that we soon see an integrated "upload-module" which integrates images, audio and video, reads tags, allows mass-uploads and node-type dependent user-rights. That of course would be ideal and allow to get rid of a lot of overhead in the various modules.

Best
Rainer

psicomante’s picture

you could see what the image module do when a user uploads an image. We could apply that to the video.module in the same manner?

patchak’s picture

Any news about how the direct upload integration is going??

I can't wait to use this on my sites!!!

patchak

fax8’s picture

I'm working on it... I created a video_upload.module that will be part of the default video module package (located in a plugins directory).
The video_upload.module add a upload video field on the video node creation page.

I have still something to check and complete but I'm not too far...
Think that in a week or two everything will be ready.

(I'm working in parallel on XHTML Compliance and thumbnailing)

Fabio

jeforma’s picture

I am also looking forward to this update fax, hope it goes well :)

fax8’s picture

Status: Active » Fixed

this has finally been implemented in the video_upload.module plugins.

See http://drupal.org/node/69581 for more details.

Fabio

Anonymous’s picture

Status: Fixed » Closed (fixed)