Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

When we write programs that "learn", it turns out we do and they don't.


devel / comp.lang.javascript / Re: Upload directory

SubjectAuthor
* Upload directoryAndrew Poulos
+- Re: Upload directoryJJ
`* Re: Upload directoryThomas 'PointedEars' Lahn
 `* Re: Upload directoryAndrew Poulos
  `- Re: Upload directoryThomas 'PointedEars' Lahn

1
Upload directory

<9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17156&group=comp.lang.javascript#17156

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date: Wed, 30 Jun 2021 20:02:18 -0500
Newsgroups: comp.lang.javascript
X-Mozilla-News-Host: news://news.iinet.net.au:119
From: ap_prog@hotmail.com (Andrew Poulos)
Subject: Upload directory
Date: Thu, 1 Jul 2021 11:02:13 +1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.11.0
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-AU
Content-Transfer-Encoding: 7bit
Message-ID: <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au>
Lines: 7
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 203.221.138.97
X-Trace: sv3-Vj26qpEmrptEjCEJVPFctqYLZWOziQtq8oOxbCKiYfpj/KS7WFz/s2K5zk33Prn5szb7LPVtx03TijH!Shps2Ne06RZDdmGna+xe3PiVJsr8LVuwLdrm/Dj9/TOu+FkSyEkJy+Dj5n/7oRZIWAL/gtD1AO7+!c/PT510zGpjBWYGNLK9ntA==
X-Complaints-To: abuse@westnet.com.au
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1411
 by: Andrew Poulos - Thu, 1 Jul 2021 01:02 UTC

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?

I found webkitdirectory but MDN doesn't recommend using it.

Andrew Poulos

Re: Upload directory

<1366nvcnoot3f$.962mszyr27w7.dlg@40tude.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17157&group=comp.lang.javascript#17157

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!aioe.org!kCa/MpAQsvVY6DnDP/ag2w.user.gioia.aioe.org.POSTED!not-for-mail
From: jj4public@gmail.com (JJ)
Newsgroups: comp.lang.javascript
Subject: Re: Upload directory
Date: Thu, 1 Jul 2021 13:10:50 +0700
Organization: Aioe.org NNTP Server
Lines: 14
Message-ID: <1366nvcnoot3f$.962mszyr27w7.dlg@40tude.net>
References: <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au>
NNTP-Posting-Host: kCa/MpAQsvVY6DnDP/ag2w.user.gioia.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: 40tude_Dialog/2.0.15.84
X-Notice: Filtered by postfilter v. 0.9.2
X-Face: \*\`0(1j~VfYC>ebz[&O.]=,Nm\oRM{of,liRO#7Eqi4|!]!(Gs=Akgh{J)605>C9Air?pa d{sSZ09u+A7f<^paR"/NH_#<mE1S"hde\c6PZLUB[t/s5-+Iu5DSc?P0+4%,Hl
X-Bitcoin: 1LcqwCQBQmhcWfWsVEAeyLchkAY8ZfuMnS
 by: JJ - Thu, 1 Jul 2021 06:10 UTC

On Thu, 1 Jul 2021 11:02:13 +1000, 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?
>
> I found webkitdirectory but MDN doesn't recommend using it.
>
> Andrew Poulos

webkitdirectory is the only thing which allow multipart file names to have
(relative) path.

Without webkitdirectory, you'll have to construct the multipart data and
provide the required HTTP request headers manually.

Re: Upload directory

<6351394.aQ5ZTYclbD@PointedEars.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17160&group=comp.lang.javascript#17160

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.178.197.216.189!not-for-mail
From: PointedEars@web.de (Thomas 'PointedEars' Lahn)
Newsgroups: comp.lang.javascript
Subject: Re: Upload directory
Date: Thu, 01 Jul 2021 12:55:59 +0200
Organization: PointedEars Software (PES)
Lines: 16
Message-ID: <6351394.aQ5ZTYclbD@PointedEars.de>
References: <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au>
Reply-To: Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7Bit
Injection-Info: gwaiyur.mb-net.net; posting-host="178.197.216.189";
logging-data="11538"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: KNode/4.14.10
Cancel-Lock: sha1:9mrTcBi/R+bIx2snW5vOveLb0r0=
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
X-User-ID: U2FsdGVkX18e8Ngf3frsmPagQO/OV+VhcwBnz+FLNZ+C8jbNejprDA==
X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
 by: Thomas 'Pointed - Thu, 1 Jul 2021 10:55 UTC

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.
--
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.

Re: Upload directory

<j8idnZ3TY8N_30P9nZ2dnUU7-eudnZ2d@westnet.com.au>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17163&group=comp.lang.javascript#17163

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!nntp.westnet.com.au!news.westnet.com.au.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 01 Jul 2021 17:34:10 -0500
Subject: Re: Upload directory
Newsgroups: comp.lang.javascript
References: <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au> <6351394.aQ5ZTYclbD@PointedEars.de>
From: ap_prog@hotmail.com (Andrew Poulos)
Date: Fri, 2 Jul 2021 08:34:09 +1000
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0
MIME-Version: 1.0
In-Reply-To: <6351394.aQ5ZTYclbD@PointedEars.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-AU
Content-Transfer-Encoding: 7bit
Message-ID: <j8idnZ3TY8N_30P9nZ2dnUU7-eudnZ2d@westnet.com.au>
Lines: 18
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 203.221.138.97
X-Trace: sv3-QllWPxyH7Qf1Z2LlNeBdwt+47SKIkVLbLjmJjNBe/f4EAtAVkxq/DzTcPDoMneG1W6xjgtimNNDfZ4n!GPQon+6FQTlQEGZD+c4TSLG9u9WJHRm7f2y8uJoOWyH6K+yPKmpebGtqddA2+kFb6lyPOQXEtQZA!SgYV8l28khnkTsYYZGvmrA==
X-Complaints-To: abuse@westnet.com.au
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1889
 by: Andrew Poulos - Thu, 1 Jul 2021 22:34 UTC

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?

Andrew Poulos

Re: Upload directory

<2450771.yXyze288zr@PointedEars.de>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17164&group=comp.lang.javascript#17164

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!aioe.org!news.mb-net.net!open-news-network.org!.POSTED.178.197.216.189!not-for-mail
From: PointedEars@web.de (Thomas 'PointedEars' Lahn)
Newsgroups: comp.lang.javascript
Subject: Re: Upload directory
Date: Fri, 02 Jul 2021 02:26:03 +0200
Organization: PointedEars Software (PES)
Lines: 34
Message-ID: <2450771.yXyze288zr@PointedEars.de>
References: <9rudnW-JDaqHiUD9nZ2dnUU7-WvNnZ2d@westnet.com.au> <6351394.aQ5ZTYclbD@PointedEars.de> <j8idnZ3TY8N_30P9nZ2dnUU7-eudnZ2d@westnet.com.au>
Reply-To: Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8Bit
Injection-Info: gwaiyur.mb-net.net; posting-host="178.197.216.189";
logging-data="16713"; mail-complaints-to="abuse@open-news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Yg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
 by: Thomas 'Pointed - Fri, 2 Jul 2021 00:26 UTC

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.


devel / comp.lang.javascript / Re: Upload directory

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor