<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#0070C0'>Jean-Paul,<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Does that mean you want to be able to do an HTTP PUT to start an upload and then poll the upload status with HTTP GET?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#0070C0'>I checked the Nextcloud code to see how it handles HTTP Put. It looks like Nextcloud files_external applications that use HTTP (like the Amazon S3 plugin) use a combination of the icewinds php stream wrapper and guzzle http to monitor a file upload via http put. Guzzle http is a php package that support asynchronous http operation. The S3 plugin uses a combination of the icewinds php stream wrapper and guzzle http to monitor the number of bytes transferred from a local file to the web server via HTTP put.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#0070C0'>Using the method I described above, all I would need is a way to do a synchronous HTTP put of a local file to a URL representing an immutable file resource on the Tahoe-LAFS server. <o:p></o:p></span></p><p class=MsoNormal><span style='color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#0070C0'>Note that this approach is extremely complicated in php but is likely doable.</span><span style='color:#0070C0'><o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If not, what does your ideal interaction between Nextcloud and Tahoe-LAFS look like?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='color:#0070C0'>The simplest approach would be to make progress functionality available via the tahoe CLI.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#0070C0'>One implementation approach would be to have the Tahoe “cp” CLI send progress indications to stdout as it is copying. The progress indications could be in terms of bytes transferred, % complete, etc. If this type of functionality was available, then I could simple use this php code snippet to monitor progress in PHP:<o:p></o:p></span></p><p class=MsoNormal><a href="https://stackoverflow.com/questions/45953/php-execute-a-background-process#45966">https://stackoverflow.com/questions/45953/php-execute-a-background-process#45966</a><o:p></o:p></p><p class=MsoNormal><span style='color:#0070C0'><o:p> </o:p></span></p><p class=MsoNormal><span style='color:#0070C0'>                Bruce T</span><span style='color:#0070C0'><o:p></o:p></span></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Jean-Paul Calderone <jean-paul+tahoe-dev@leastauthority.com><br><b>Date: </b>Tuesday, November 26, 2019 at 8:26 AM<br><b>To: </b>Bruce Thompson <brucet.cisco@gmail.com><br><b>Cc: </b>"tahoe-dev@tahoe-lafs.org" <tahoe-dev@tahoe-lafs.org><br><b>Subject: </b>Re: Uploading files with http put<o:p></o:p></span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>On Tue, Nov 26, 2019 at 9:23 AM brucet <<a href="mailto:brucet.cisco@gmail.com">brucet.cisco@gmail.com</a>> wrote:<o:p></o:p></p></div><div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'>Jean-Paul,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Can you elaborate on what you mean by "asynchronous"?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'>PHP does not directly support asynchronous operations so I used the term loosely. </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'>Nextcloud includes a stream package that does callbacks on php streams. This is a link to the icewinds php stream wrapper which is included in the nextcloud code:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><a href="https://github.com/icewind1991/Streams" target="_blank">https://github.com/icewind1991/Streams</a><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'>This library supports callbacks to provide updated status in the web UI when performing reads / writes on a php stream. This functionality works with http put / get. I am using this functionality for file downloads from Tahoe-LAFS by using http get. I would like to do the same for file uploads to Tahoe-LAFS by using http put.</span><o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Does that mean you want to be able to do an HTTP PUT to start an upload and then poll the upload status with HTTP GET?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If not, what does your ideal interaction between Nextcloud and Tahoe-LAFS look like?<o:p></o:p></p></div><div><p class=MsoNormal> <o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='color:#0070C0'>                Bruce T</span><o:p></o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:12.0pt;color:black'>From: </span></b><span style='font-size:12.0pt;color:black'>Jean-Paul Calderone <<a href="mailto:jean-paul%2Btahoe-dev@leastauthority.com" target="_blank">jean-paul+tahoe-dev@leastauthority.com</a>><br><b>Date: </b>Monday, November 25, 2019 at 6:38 PM<br><b>To: </b>Bruce Thompson <<a href="mailto:brucet.cisco@gmail.com" target="_blank">brucet.cisco@gmail.com</a>><br><b>Cc: </b>"<a href="mailto:tahoe-dev@tahoe-lafs.org" target="_blank">tahoe-dev@tahoe-lafs.org</a>" <<a href="mailto:tahoe-dev@tahoe-lafs.org" target="_blank">tahoe-dev@tahoe-lafs.org</a>><br><b>Subject: </b>Re: Uploading files with http put</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Can you elaborate on what you mean by "asynchronous"?<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Mon, Nov 25, 2019 at 7:28 PM brucet <<a href="mailto:brucet.cisco@gmail.com" target="_blank">brucet.cisco@gmail.com</a>> wrote:<o:p></o:p></p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Never saw a response to this. Does anyone have any pointer of where to look for an answer to my question below?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Thanks,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>                Bruce T<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='color:black'>From: </span></b><span style='color:black'>Bruce Thompson <<a href="mailto:brucet.cisco@gmail.com" target="_blank">brucet.cisco@gmail.com</a>><br><b>Date: </b>Friday, November 22, 2019 at 9:08 AM<br><b>To: </b>"<a href="mailto:tahoe-dev@tahoe-lafs.org" target="_blank">tahoe-dev@tahoe-lafs.org</a>" <<a href="mailto:tahoe-dev@tahoe-lafs.org" target="_blank">tahoe-dev@tahoe-lafs.org</a>><br><b>Subject: </b>Uploading files with http put</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>I am writing a Tahoe-LAFS plugin for Nextcloud and close to having it completed. The plugin puts Tahoe-LAFS on even footing with other cloud storage systems that have been integrated with Nextcloud such as: Amazon S3 and Swift.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>The problem I am having is I need to support asynchronous uploading of local files to Tahoe-LAFS. I have not found a way to do this using the “tahoe cp” command. However, if I use an http put to perform the upload then I can support asynchronous uploads in Nextcloud.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>I am using the “tahoe” command from the plugin so I can use any tahoe command that completes in a relatively short period of time. Is there a simple way for me to create a placeholder tahoe URI that I can use to perform an http put with to perform an upload?<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>Thanks in advance,<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;margin-left:.5in'>                Bruce T<o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>_______________________________________________<br>tahoe-dev mailing list<br><a href="mailto:tahoe-dev@tahoe-lafs.org" target="_blank">tahoe-dev@tahoe-lafs.org</a><br><a href="https://tahoe-lafs.org/cgi-bin/mailman/listinfo/tahoe-dev" target="_blank">https://tahoe-lafs.org/cgi-bin/mailman/listinfo/tahoe-dev</a><o:p></o:p></p></blockquote></div></div></div></blockquote></div></div></div></body></html>