use attachment fu for uploads+solution

Image Urls in relation to file or database storage

generically, the url of images will be /$path/$name$size.$ext

 

$name could be taken either from the original filename, or the name of the card.  my inclination is cardname.  $ext would be taken from original file.  In neither case is the url necessarily stable: the filename or extension could change on subsequent uploads.  however if we use cardname then the uniqueness of the name is already preserved.  $size is the optional extension for resized versions of the image, ie. "_thumb"

 

$path depends on implementation.  If we want to be able to serve files directly from apache, then the web path must match the filesystem path, and the filesystem path needs disambiguation  between multihosted wagns and probably should have a couple of levels of subdirectories to avoid overloading one directory, ie.  /card_images/$wagn_id/0003/0204/$name$size.$ext 

 

If we're willing to give up that optimization and go through the database then we can use the same path as regular cards,   /$name$size.$ext  or /wagn/$name$size.$ext

 

 

 

 

Files and images

 

Allow file/image name on server to be different from the card's name.
(We were changing the file's name to match the card name if that was predetermined.)

If the card name is not already specified when the file is uploaded, fill in the card name with the name of the uploaded file. Allow 'illegal' characters - they'll be checked on card creation.
Question: Does the cardname keep or delete the extension?

Keep content view as the name of the file, linked to the file. (We considered "Download" or "Download " linked to the file.)

 

Images

 

in inclusions, people can add:
|size:full (size as uploaded)
|size:icon (16 pixels max height/width)
|size:small (75)
|size:medium (200) - default if no size is specified
|size:large (500)
images are scaled up/down to all those sizes when uploaded

if any included card is in content view, pass CSS (e.g. |height: and |width:) in rather than apply it to the card
(if that becomes hairy, push to post-1.0)

 

When editing an image card that already has an image, something like this:

 

Current image:

 

|show current image, size:small|

 


 

|text box|  Browse...

 

|checkbox|  Delete picture (but keep card)

 

Save   Cancel                           Delete |cardname|

 

 

Question: did we come up with where/how in there to let people remove the current image without uploading a new one?

 

No.  Suggest "Reset to Blank" link below the current image.

 

 

view (line) not supported for use attachment fu for uploads+solution+more thoughts