First time here? Check out the FAQ!
2

Plans to support attachments other than images? [done]
 

I noticed that askbot support uploading of images, so presumably there is infrastructure in place to store binary blobs.

I would like to request support for generic attachments.
I realize we can use a link to a storage location, but it would be nice to have everything using the same front-end.

Not a huge priority, but definitely a nice feature to have in the context of a corporate site.

Update:
After thinking about this, I believe this feature could look like this:

  • In the editor, add a new command (ctrl-F ?)
  • ctrl-F brings up a navigation dialog to select the file
  • The selected file is uploaded to a configurable directory.
  • Should automatically add a unique prefix to file name to avoid name clash.
  • A hyperlink (similar to ctrl-L) is linked to any highlighted text.

I believe that would provide an acceptable way to upload (and link to) files.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago
Benoit's avatar
875
Benoit
asked 14 years ago

Comments

see more comments

2 Answers

1

Since we don't particularly care about images, but want links to uploaded files, with minor changes, we were able to implement this functionality.

Ctrl-G inserts a link instead of an image. Modify skins/default/media/js/wmd.js and in doLinkOrImage, around line 1742, remove the ! from the start tag to make it a link instead of embedding an image.

In views/writers.py, upload function, around line 59:

  • Remove the check on extensions (we don't care to limit to just images)
  • Changed the new_file_name to retain the original file name (instead of a numerical name)

Definitely not appropriate for everyone, but it meets our need.

If this is functionality that askbot would want to provide in the regular release, I would suggest adding a new command/icon to WMD (ctrl-F for file or ctrl-U for upload?).

Probably would require a few more changes to upload to distinguish between images (and limiting extensions) and files (without limits).

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Benoit's avatar
875
Benoit
updated 14 years ago, answered 14 years ago
link

Comments

I'll try to do something about this today. Also the parsers (prewiewer and the python server side) will requre some change.
Evgeny's avatar Evgeny (14 years ago)
Sorry for the typos, commented on the phone in a hurry. Ability to edit comments is also on the list :).
Evgeny's avatar Evgeny (14 years ago)
see more comments
0

edit: made this feature to work, but you still have to specify a list of uploaded file types in settings.py file (in the parameter ASKBOT_ALLOWED_UPLOAD_FILE_TYPES, also there is ASKBOT_MAX_UPLOAD_FILE_SIZE - max file size in bytes.

The keyboard shortcut still does not work though (Ctrl-F is probably not a good choice anyway).

This site only accepts pdf attachments.

pdf-test.pdf

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
updated 14 years ago, answered 14 years ago
link

Comments

I don't think attached files would have to show up in the main text field as markdown. I think it would be fine if there was another section (between Question and Answers or at bottom of the page) that would list the various attachments available with a link to launch a download.
Benoit's avatar Benoit (14 years ago)
see more comments