Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #40283

Re: Upload directory

From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Upload directory
Date 2021-07-02 02:26 +0200
Organization PointedEars Software (PES)
Message-ID <2450771.yXyze288zr@PointedEars.de> (permalink)
References <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au> <6351394.aQ5ZTYclbD@PointedEars.de> <j8idnZ3TY8N_30P9nZ2dnUU7-eudnZ2d@westnet.com.au>

Show all headers | View raw


Andrew Poulos wrote:

> On 1/07/2021 8:55 pm, Thomas 'PointedEars' Lahn wrote:
>> Andrew Poulos wrote:
>>> How do you allow the user to select a directory (that includes multiple
>>> files and  sub-directories) and then upload that to a server while
>>> keeping the existing directory structure?
>> 
>> Accept only (compressed) archive files:
>> 
>> <https://en.wikipedia.org/wiki/List_of_archive_formats>
>> 
>> Every modern file manager includes a way now to create such an archive
>> file.
> 
> So you're saying that I should instruct the user to archive the
> directory they want uploaded and then (in the web page) select the
> archive?

I suggest to have two “input” elements: One where you use the 
“webkitdirectory” attribute, another one where you only allow the upload of 
an archive file.  You could make the choice more obvious by using radio 
buttons that cause only one of the “input” elements to be shown.

(And, if you wish, an extensible group of input controls with which several 
files of supported types can be uploaded.  But note that you can also have 
one “input” element where several files can be selected.)

Be sure to check the MIME media/file type server-side, too.

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Upload directory Andrew Poulos <ap_prog@hotmail.com> - 2021-07-01 11:02 +1000
  Re: Upload directory JJ <jj4public@gmail.com> - 2021-07-01 13:10 +0700
  Re: Upload directory Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-07-01 12:55 +0200
    Re: Upload directory Andrew Poulos <ap_prog@hotmail.com> - 2021-07-02 08:34 +1000
      Re: Upload directory Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-07-02 02:26 +0200

csiph-web