i have large mp3 files over 50MB.

is there a way I can import them from their location on the files system, instead of uploading? The uploads timeout always.

thanks

Comments

drewish’s picture

Title: import feature » import files from the local file system

i think this is a pretty important feature. it wouldn't be too hard to implement using the audio_api_create_item() function that's in the 4.6 branch or using the audio_api_insert() function in the 4.7 fork in my sandbox.

if you want an example of how to do it with my 4.7 fork take a look at the _station_archive_import_files() in the station archive module. streamripper is called by a unix cron job to rip hour long chunks of a webstream and save them into an import directory. the module uses a drupal cron job to scan the directory for mp3s, create audio nodes and then save in the metadata.

i'd want to play around with ideas for a general solution to the problem before deciding on anything. how would you like to see it work? how about the admin configures an audio upload directory. when you're creating/editing an audio node it scans for files in that directory and lets you either select one or upload something from the browser.

derby’s picture

well...

thanks for this module by the way!!

as admin i would want to create a mp3 folder under files.

have my users upload via sftp

then when the user logs into drupal, perhaps there is a menu item to import audio. This will scan the directory files/mp3/ for new mp3 files and import them as nodes, files, and meta data.

I would like to write a simple php script to talk to the drupal db directly, but I have no idea about drupalizing it.
my script instead would run under cron or perhaps a hard file /import.php

drewish’s picture

well, collin's the one to thank, i just try to help out.

i don't think it would be a good idea to have the upload directory under files, that's just asking for users to overwrite an existing file. maybe temp/audio or something.

i think a custom module would be the easiest way to get it working for your site. using the cron hook works well for me. the only thing is that you'd have to automate most of the import process, setting titles and the like. a better plan maybe, as you suggested adding a menu item to scan the directory, import the files and then provide a list of the new nodes so you could edit them at that point.

if you want to try it i'd be happy to offer advice. i don't have time for much more than that but i'll answer any specific questions you've got. i would recommend that you take a look at the station archive module i linked to above. a good chunk of it is 4.7 specific but it would provide a good starting point for the import directory scanning.

Bèr Kessels’s picture

IMO this should be dealt with on a lower level.
Why an import in audio. Another one for images. Again another import for PDFs, and yet another one for Any other files.

I already have a place reservated for this in the new upload module and file system (betteruplaod). But I will continue development on that when core (4.7) is more stable then now.

drewish’s picture

Ber, you've got your work cut out for you ;) I'm looking forward to seeing what you come up with.

RussellH’s picture

I too am having the same problem. Just starting a podcast, and even a 10 meg file is timing out all the time. And with the "nobody" permissions assigned to the audio directory and files, it's even hard to load a dummy placeholder file, and then replace it with the real file via FTP.

Just being able to browse around the unix file system to select the file would be enough for me.

drewish’s picture

Assigned: Unassigned » drewish
Status: Active » Postponed

I'm going to put this in a contrib module once the 4.7 changes get committed.

drewish’s picture

Status: Postponed » Active

ok my 4.7 code is committed this is back in the queue...

drewish’s picture

see also http://drupal.org/node/54855 "Need place to enter URL instead of upload"

drewish’s picture

Status: Active » Closed (duplicate)

whoops, this got solved over here: http://drupal.org/node/40889