Hi everyone,
I finally figured out a way to do this on my own so I figured I'd share in case someone else needs to know. I'm using the very cool audio module (http://drupal.org/project/audio) to add audio content to my site. The problem is that my host limits uploads at 16MB, which is too small for many of the files we want to add to the site. (Most are 17-24MB). We use Media Temple as our host. We've adjusted our .htaccess to allow 16mb but that is the limit.
I could have (and did once) just make a generic entry, upload the file via FTP and hard code the flash player link. This is not a good long term solution, and it makes the content type story instead of audio - kind of defeats the purpose.
So here's what you do.
1. Prepare your mp3 file, then dupe it and make a copy that has only like 10 seconds of audio in it, which will be nice and small.
2. Add audio content as normal, adding the "scratch" version during the upload process, and submit the content.
3. Now you have your audio node, but with the short file only. Take the full sized file and FTP over the scratch file.
4. Here's the catch - you *must* go to that node and enter edit mode for this to work. Simply dragging it over doesn't seem to do the trick. When you enter edit mode, you should see the MP3 details adjust to the larger file. Save the changes (even though you haven't actually done any editing)
And viola! You now have your large file uploaded as an audio node.
Tom
Comments
Great fix
This workaround works like charm thanks.
Elaborate more plaease
Could you elaborate more please on where and what htaccess file you are referring to I found one in my root folder but when I looked inside of it I saw no reference to file size limitations or any reference to files of any kind. Am I missing something, is this the wrong place to look on my server. I have Drupal on a hosted site. I am using the audio module which is a very cool module but the 2MB limitation is not going to work I need to set it to 4.5 MB in size. Thanks for helping in advance.
You'll have to add the info
You'll have to add the info to your htaccess to get it to work. I don't have the info handy right now at work, but if you search on htaccess and upload limit you should find it.
It is the file in the root.
It is the file in the root. It should look something like this; (IMPORTANT MAKE A BACK UP OF YOUR FILE FIRST just in case)
register_globals=on
allow_url_fopen = off
expose_php = Off
max_input_time = 60
variables_order = "EGPCS"
extension_dir = ./
upload_tmp_dir = /tmp
precision = 12
add the code below in the space I left blank
memory_limit = 65M
post_max_size = 65M
file_uploads = On
upload_max_filesize = 65M
That's what I did and it did increase my upload limit, but not to the amount I wanted. Change the 65M s to the number you want example 5M for 5 MB. If your hosting provided allows that limit your good to go. If not you will have to use the work around.
php.ini file
Hey thanks for the help guys, I added the code to my htaccess file and it basically took my site down, I could no longer browse my site. I went back into my host site through my cpanel and took the lines out and my site came back up. I contacted my host provider and they said I just needed to create a php.ini file in the root of drupal and add those lines of code there. I did that and it works great, I now have the ability to upload up to 5 MB files which is fine by what my site is designed for. One thing I noticed though in the audio module is that now it reports max size to be 4MB instead of 2MB that it used to say but it should be reporting 5MB, OH well no biggy deal.
I checked out the .htaccess
I checked out the .htaccess file in the root of my drupal site & it looks nothing like your one :
So I'm not sure where I can add the code & in what format ?
Different Method
Guys,
This work around does the job but I believe there is a much quicker method.
The workaround requires FTP access and Admin access to drupal so you need to make sure you have these first.
What you need to do is create a tempory directory on your drupal site for example. tmp\audio
You can then upload as many mp3's and as big as you like via FTP to this directory.
Then login to your Drupal site as an Admin and goto Administer then click the 'By Module' tab and then under audio import click 'Audio Import Settings'
On the next screen set the directory to the one you used above and click save.
From now on whenever you wish to add audio nodes that are larger than the upload permits you can simply upload the audio to your temporary directory, login to Drupal and then click administer and then 'Audio Import'.
You can import multiple files at once using this method or simply just a few, and this way you do not need to mess around with your .htaccess file.
Hope that helps guys,
Rix
Other users on the site
The ftp method you mention is great if it is only the Admin of the site, unless you have your site set up to allow other users ftp capabilities to upload larger files that is. Or you plan on doing all the files for the other users of the site. Because of the way my site is handled I had to create an ini file to allow for larger upload of files, works great for me. I do wish the audio module had a graphic upload indicator to let users know that their file is still being uploaded and therefore keeping them from getting to anxious and leaving the page too soon. Am I missing something on this point, that is for a multiple user based site I'm talking about?
Add "Import Audio" Granularity to Permissions
It's pretty simple to add permissions granularity in Drupal 5. I needed to allow some users to import audio without allowing them access to all the audio settings so I hacked the '/audio/contrib/import/audio_import.module' file at about line 29 (5.x-2.x-dev)
Then hacked '/audio/audio.module' file at about line 197 (5.x-2.x-dev)
Done. Now you have a new permission that says 'import audio'. Assign that permission to the role you want and those users will be able to import audio from the FTP directory.
Help
I did this and was able to import the files. But how do a post these audio files once they've been imported??
fixed
I just managed to fix this by adding this to the relevant part of the .htaccess file :
php_value post_max_size 200M
php_value upload_max_filesize 200M
php_value max_execution_time 1000
php_value max_input_time 1000
(added at the base of whichever PHP/Apache version the server uses)
Had to put 200m which now allows the upload/post max size as 100m.
Not sure why I had to double the amount to get only half ?
But it works.
Media Temple has instructions here
http://kb.mediatemple.net/questions/137/%28gs%29+HOWTO%3A+edit+php.ini
super simple and best way to do it.