i don't really know where to put this, but i really don't feel like i have to time to maintain a module. so, i'm instead posting a link to my superuploader module here.

features:

  • gmail-style javascript interface (should degrade gracefully for non-javascript users)
  • uses the same sql table as upload.module (so all your old files still work)
  • attachment form is themeable
  • attachment display is themeable (so you can add handlers for different filetypes. i use a flash mp3 player for my mp3 files.)
  • allows users to "upload links", that is, if you don't want to allow a user access to uploading files, they can link to a file on another server and still make use of the themeable interface.

probably cointains bugs, so please be careful! this is more of a proof-of-concept, as well as a little something for my own site. i just thought i'd share :)

note that links are also stored in the sql table, which may be incompatible with the original upload.module. you can always disable access to links in the user permissions page.

Comments

tvst’s picture

ok, drupal didn't like my link. so here's a new one (i renamed the file):

http://www.varal.org/media/superuploader.txt

just rename it to superuploader.module

jasonwhat’s picture

Is this for 4.5 or 4.6? Doesn't a javascript file need to be included? The link is just to the module file? Has anyone else tried this out?

tvst’s picture

there's no need for a separate javascript file: the module automatically writes inline javascript.

this was the easiest way to make sure it wrapped around the "form_" functions. it also makes installation simpler -- only one file.

urbanfalcon’s picture

I have an altered version of upload.module that uses a lot of your ideas, but built directly on the 4.6 upload.module framework and without upload links (couldn't get them to function predictably). Bonuses being that it handles tmp attachments the same way as upload.module, carries them across previews, etc., but allows for multiple uploads in one edit session. Would you be ok with my releasing it as long as you are given proper credit?

vwX’s picture

While I wouldn't call it super, it is a great contribution and works well. Testing it on a 4.6 site I will put into production soon.

Have fun and check my Drupal Profile: http://drupal.org/user/519

tvst’s picture

but i didn't know what to call it!

deekayen’s picture

Where can I see it installed already?

urbanfalcon’s picture

This is a great mod. It allows for multiple file uploads directly via the upload.module instead of routing through image.module, which is exactly what I was looking to do. The only thing I saw that it needed was this correction:

    case 'settings':
      $output[t('super-attachments')] = form_checkbox(NULL, "superuploader_$node->type", 1, variable_get("superuploader_$node->type", 1));
      break;

where the output title used to be ('attachments') - as-is, it wasn't allowing the capacity to view this as a separate, configurable module. Otherwise, seems to be working a-ok on my 4.5 installation.

bomarmonk’s picture

I've installed this and changed attachments to super-attachments, but I can't locate an interface for the module and I don't see it listed in my access permissions. I'm using Drupal 4.6.

jasonwhat’s picture

I've installed this and changed attachments to super-attachments

What do I have to do to "change" attachments to super-attachments?

tvst’s picture

should be under "access control" > "superuploader module".

jasonwhat’s picture

I don't get this module, does it replace the old upload module, just copy over it? Or is it a separate file named superuploader.module? Does the old upload have to be disabled?

tvst’s picture

it's a separate file and the old upload module has to be disabled. well, it *can* be enabled, but since superuploader is just a copy of the upload module with added features, and since it uses the same database, there is no reason to keep both on -- unless it's for testing purposes.

urbanfalcon’s picture

Another correction to the original mod, this one will make it so that you can see the superuploads admin area...make sure the path in the callback for _menu in the module read as follows:

function superuploader_menu($may_cache) {
  $items = array();

  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/superupload', 'title' => t('superuploads'),
      'callback' => 'superuploader_admin',
      'access' => user_access('administer site configuration'),
      'type' => MENU_NORMAL_ITEM
    );
  }
jasonwhat’s picture

Could you post the entire corrected version please?

tvst’s picture

redownload from the link above.

tvst’s picture

i've updated the code.

adrian’s picture

You should consider contributing patches for drupal core.

Development of an extended set of form_ fields that are ajax aware has just started :
http://drupal.org/node/22519

The plan, is too create an ajax.module in contrib with this code, that means contrib modules can start using this functionality quicker.

--
The future is so Bryght, I have to wear shades.

tvst’s picture

i've been busy lately, and kind of forgot about this post until now! i'll read everything and reply as soon as possible. a few things, though:

this pseudo-module works for both 4.5.x and 4.6. (i call it a pseudo-module because i do not plan on maintaining it, but anyone is welcome to do so. i just made it for myself and decided to post the code for others to implement it however they want to)

i found a couple of bugs, so far -- especially with the "list" checkbox. i'm only beginning to program with php, so if anyone would like to take a look at the code (and fix bugs), be my guest. i can host the modified file if you do not have access to a web host.

tvst’s picture

hope this all helps...

azote’s picture

cool.. man .. works great..

jasonwhat’s picture

I like the looks of this module but I cannot get it working. It attaches the file in the preview, but it isn't there when I submit.

The main reason I want to use this is because I want to have links to files on other sites as enclosures for podcasting purposes. Would this module support this?

troubadour’s picture

Tried to snag this but it looks like the site is down. Say it ain't so.

tvst’s picture

i can't edit the first post, but there was a problem with drupal not liking that the file had a ".module" extension. so i changed it to ".txt" and posted a new link on the first reply in this topic.

anyways, the link is again here:
http://www.varal.org/media/superuploader.txt

save it to your computer and rename to "superuploader.module" to use.

m3avrck’s picture

For consistency, wouldn't it be better to move the settings for Superuploader to the "settings" parent in the admin menu, instead of having "administer" as the parent?

Also, if it this module is working in conjunction with upload.module, wouldn't it better to pull the max file upload size from the upload.module settings instead of having another one for the superuploader??? Maybe don't even need this setting for Superuploader since it is kind of redundant.

tvst’s picture

this module DOESN'T run in conjunction with the upload module: it replaces it. you should NOT run them side by side.

let me reiterate that this module is just something i hacked for my own site and decided to share the code. if it wasn't for that, maybe the best approach for this module would be to indeed write it to coexist (and build upon) with the original upload module. this is not what i did.

i welcome others to try and make something more elegant out of this module. :)

m3avrck’s picture

Also, can't even get Superuploader to work with PHP5!! Seems the problem stems from the fact that array_merge() was changed slightly in PHP5: http://us2.php.net/array_merge

An update would be great! Thanks!

tvst’s picture

i don't have php5 installed, but it should be fixed now.

kzeng’s picture

Super module! I like it. Will it be upgraded to be compatible with drupal 4.7? Or has it already been incorporated into drupal 4.7?

--------------------------
http://www.kzeng.info