UI to import existing files from the server

darksayings - December 7, 2008 - 04:59
Project:FileField
Version:6.x-3.0-alpha5
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

On shared hosting with strict memory and time limits, FileField isn't usable for things like audio or video. The field_file_save_file() function allows importing a file that's already uploaded, but users need a way to access that functionality.

According to these places, I'm not the only one with this concern:

  1. #208224: Allow files from server
  2. #257220: Specifying a file already uploaded (The main point of this feature request is somewhat different, but this is mentioned as a secondary issue.)
  3. http://drupal.org/node/291934#comment-974574
  4. http://mustardseedmedia.com/podcast/episode17#comment-141

I've written a module that adds a choice of two widgets that allow importing existing files rather than uploading local files. It has a lot of room for improvement, but it's perfectly usable now.

Some of the things it does are:

  1. Uses field_file_save_file() to copy a file from some import directory (set in the field/widget's settings).
  2. Adds a text widget that autocompletes filenames.
  3. Adds a widget that uses a select element, configurable as either a drop-down list or a list box, containing a list of files available to be imported.
  4. Adds two permissions - one to import files at all, and one to see the listing of files.
  5. If the user doesn't have permission to view the directory listing, degrades either widget to a plain text area without autocomplete.

These are some things it doesn't do (at least, not currently):

  1. Allow two nodes to point to the same file. It copies the file, so one node would point to, e.g. file.txt, and the other would have file_0.txt
  2. Allow a user to choose either to import an existing file or upload a new file with a single widget. I think the difficulty here is more a UI problem of presenting the choice in a way that makes sense than a technical problem of implementing it.
  3. Detect whether the import path and destination path are the same (to prevent file renaming issues). My approach would be to document in huge, bold, underlined, red, all-caps letters with circles around it that it's not recommended, but to allow it if you feel you need to - it won't break anything.

As this is written, it's a separate module. Would it be better to keep it separate, apply for CVS access, and create a new project? Or would it be better to rework it into a patch to be reviewed here?

#1

dopry - December 9, 2008 - 21:34

for inclusion in filefield you should implement it as a filefield widget. You can either choose to release it in it's own module or submit it for inclusion in filefield...

#2

darksayings - December 10, 2008 - 22:03

Thanks.
I think I'll make some changes (usable isn't the same as finished) and keep it a separate module.

#3

jdschroeder - December 30, 2008 - 20:10

How is the progress on this module? I have this very issue on a client site, and would be willing to do some testing if it's available in a beta stage.

#4

Psicomante - December 30, 2008 - 23:22

+1 following

#5

glidetothehoop - January 21, 2009 - 03:11

Any update on the availability of this import capability for FileField? I'm trying to figure out the best way to import a bunch of audio files.

#6

scroogie - January 21, 2009 - 19:09

Subscribing. It would be awesome if it would get a nice UI (like the media browsers in Wordpress, Serendipity, Joomla etc.).

#7

mbiddlecombe - January 22, 2009 - 16:14

subscribing

#8

stoltoguzzi - January 22, 2009 - 16:19

subscribing

#9

dopry - February 5, 2009 - 03:05
Status:active» closed

thanks darksayings.. good luck with your development... let me know when you think it's in good shape and I'll add a link to it to the filefield page. I really look forward to seeing it.

#10

elally - February 12, 2009 - 03:02

subscribing

#11

nk_ - February 16, 2009 - 15:06

subscribing

#12

perandre - February 18, 2009 - 10:36

Sub

#13

glidetothehoop - March 17, 2009 - 12:22

@darksayings: is the module you've made for importing available yet? If not, how would you suggesting I import files into a filefield that already exist on my webserver?

Thanks!

#14

momper - March 28, 2009 - 18:25

subscribing

#15

thiokol - June 11, 2009 - 02:54

no sign of this yet? I really need this functionality too

#16

batje - September 2, 2009 - 18:20

subscribe

#17

marklein - September 14, 2009 - 17:48

subscribe

#18

wilk4 - October 22, 2009 - 01:51

subscribe

 
 

Drupal is a registered trademark of Dries Buytaert.