Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Topic started by: MrMike on September 23, 2015, 01:04:52 PM

Title: Drag to upload
Post by: MrMike on September 23, 2015, 01:04:52 PM
I'd like to propose a feature to be implemented as either a standard feature or as a mod package.

The feature I'd like to suggest is "drag to upload" for attachments and images. This kind of file upload is implemented on lots of sites (Imgur, Google image search, Yahoo mail and also (I think) in GMail, to name a few).

Basically you just grab an image or file with your mouse, drag it over a spot on the page (or the whole page), and release it. The image is automatically uploaded without any dialog box or file picker.

It seems to be a fairly easy thing to implement, and I see it appearing on more and more sites.

I think this would be a very useful/practical feature, and I also think it would be an extremely popular feature as well.

What do you think- is there any interest in this?
Title: Re: Drag to upload
Post by: margarett on September 23, 2015, 01:15:17 PM
Quote from: MrMike on September 23, 2015, 01:04:52 PM
It seems to be a fairly easy thing to implement
Actually it isn't :P

There's an "in-development" feature (still not finished) for 2.1 which should improve attachment handling.
Title: Re: Drag to upload
Post by: MrMike on September 23, 2015, 02:17:38 PM
Quote from: margarett on September 23, 2015, 01:15:17 PM
Actually it isn't :P

I'm curious, can you tell me what it is that's difficult (or not easy) to implement about this kind of feature?

There are a variety of scripts and packages that offer this, for example the Fine Upload (http://fineuploader.com/) system.

I realize that one isn't free, but there are numerous free code examples that provide the basic functionality. This is one of them:

http://code.runnable.com/VJqsfoxw5lAXYkCZ/drag-and-drop-feature-html5-for-fileupload (http://code.runnable.com/VJqsfoxw5lAXYkCZ/drag-and-drop-feature-html5-for-fileupload)

That one uses dropzone.js, but there are others, including some that are just the bare essentials. One of them is found at http://html5demos.com/dnd-upload (http://html5demos.com/dnd-upload) 

or  http://html5doctor.com/drag-and-drop-to-server/ (http://html5doctor.com/drag-and-drop-to-server/)

There are also loads of jQuery-based DnD uploaders, and if it can be done in jQuery it can be done without jQuery (since jQ is really at its heart just a javascript library).


Quote from: margarett on September 23, 2015, 01:15:17 PMThere's an "in-development" feature (still not finished) for 2.1 which should improve attachment handling.

Cool...what kind of improvements? Will it include a drag-to-upload feature, or...?  :)
Title: Re: Drag to upload
Post by: Kindred on September 23, 2015, 02:33:47 PM
I do not believe that it includes drag to upload...  and, quite honestly, I think that "feature" would be a waste of resources on a forum...
Title: Re: Drag to upload
Post by: MrMike on September 23, 2015, 06:48:49 PM
Quote from: Kindred on September 23, 2015, 02:33:47 PM
I do not believe that it includes drag to upload...  and, quite honestly, I think that "feature" would be a waste of resources on a forum...

I don't see why, as image/attachment uploading is a pretty popular feature...why not make it easier for users to do?
Title: Re: Drag to upload
Post by: Kindred on September 23, 2015, 06:51:55 PM
because it is not nearly as easy as you seem to think.
Title: Re: Drag to upload
Post by: MrMike on September 23, 2015, 06:57:04 PM
Quote from: Kindred on September 23, 2015, 06:51:55 PM
because it is not nearly as easy as you seem to think.

Okay, if it's not easy then we shouldn't even consider it.  ;)   lol
Title: Re: Drag to upload
Post by: Suki on September 23, 2015, 06:59:27 PM
I've seen a few request for this so might as well jump in and make it public. Yes 2.1 will have a drag and drop, inline attachment system, still working on it.

This is yet another thing were users only see the tip of the iceberg, yes, its quite easy to use drag and drop, thats not the problem, the problem is making it compatible with SMF's attachment and post system and make it compatible with whatever weird browser the user is using too (drag and drop isn't supported by a lot of browsers).

Automatically uploading a file will not be an option, after drag and drop, user will still need to click an upload button, this are attachments and attachments in SMF has a lot of restrictions we still need to apply such as the max amount of attachments per post, max total size of all files, individual file size, file type, etc.
Title: Re: Drag to upload
Post by: MrMike on September 23, 2015, 07:03:41 PM
Quote from: Suki on September 23, 2015, 06:59:27 PM
I've seen a few request for this so might as well jump in and make it public. Yes 2.1 will have a drag and drop, inline attachment system, still working on it.

Outstanding, and thank you, Suki, for clarifying what the new features will be. I'm glad to see that DnD file uploads will make it into the new version.

It sounds as though 2.1 will be a fantastic release and I look forward to it!
Title: Re: Drag to upload
Post by: live627 on September 23, 2015, 08:21:55 PM
Quote(drag and drop isn't supported by a lot of browsers).
Even MS Edge. Microsoft, you really dropped the ball on that one. Even IE has this feature.
Title: Re: Drag to upload
Post by: MrMike on September 23, 2015, 08:28:14 PM
Quote from: live627 on September 23, 2015, 08:21:55 PMEven MS Edge. Microsoft, you really dropped the ball on that one. Even IE has this feature.

The day Microsoft makes a product that doesn't suck is the day they make a vacuum cleaner.
Title: Re: Drag to upload
Post by: live627 on September 23, 2015, 08:35:49 PM
lol I see what you did there.
Title: Re: Drag to upload
Post by: Steve on September 24, 2015, 09:42:41 AM
Okay, I had to steal that line. :P
Title: Re: Drag to upload
Post by: MrMike on September 24, 2015, 10:30:16 AM
Quote from: Steve on September 24, 2015, 09:42:41 AM
Okay, I had to steal that line. :P

Lol, fair trade if I can steal your "I have not yet begun to procrastinate" line.  :)
Title: Re: Drag to upload
Post by: Antes on November 16, 2015, 07:47:23 PM
With https://github.com/SimpleMachines/SMF2.1/pull/2839, this feature now inside SMF 2.1.