Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread PMario
On Monday, February 23, 2015 at 10:01:21 AM UTC+1, Stephan Hradek wrote:
>
> Thanks Andreas - So Mario is right with his hint that I need to convert to 
> base 64.
>

Ouch! Any doubt about this? :))
-m 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread PMario
On Monday, February 23, 2015 at 12:15:14 PM UTC+1, Andreas Hahn wrote:
>
>  Wouldn't it be possible to handle all unkown MIME types as binary data ? 
>

I think, this would be a good idea, if users wouldn't use it in the wrong 
way, which will cause support on our side. 
 

> That would ensure that people could for example embed word or excel files 
> or a bunch of other file types (at the expense of some txt/ascii based 
> formats). I am not sure if that is a good idea, 
>

While embedding unknown data as base64 is ok. Including an uncompressed 
word or excel file into a html document imo is an incredibly bad idea. So I 
vote for a  zip, gzip only approach. 

-mario

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Jeremy Ruston
Hi Andreas

Wouldn't it be possible to handle all unkown MIME types as binary data ?
> That would ensure that people could for example embed word or excel files
> or a bunch of other file types (at the expense of some txt/ascii based
> formats). I am not sure if that is a good idea, or if that is possible to
> implement since most other systems seem to access contentTypeInfo as
> hashmap.
>

Interesting. I think you're right, defaulting to base64 format might well
be better. As you say, the downside would only be that unknown text formats
would be unnecessarily base64 encoded. I've made a ticket:

https://github.com/Jermolene/TiddlyWiki5/issues/1521

I've also made a ticket for adding a download link for binary tiddlers:

https://github.com/Jermolene/TiddlyWiki5/issues/1522

Best wishes

Jeremy



>
> /Andreas
>
> Am 23.02.2015 um 11:58 schrieb Jeremy Ruston:
>
> Hi Stephan
>
>  Just to be clear, TW5 does indeed support binary tiddlers (images being
> a good example). You can drag a ZIP file into TW and the right thing
> happens. The limitation at the moment is that there's no built-in way to
> download the file afterwards. You can use something like the following code
> to create a download link for a binary tiddler:
>
>  \define download-inner(title)
> >
> download="download">Download "$title$"
> \end
>
>  \define download(title)
> <$set name="type" value={{$title$!!type}}>
> <$set name="text" value={{$title$!!text}}>
> <>
> 
> 
> \end
>
>  <>
>
>  However, the .ZIP file extension needs to be registered in boot.js
> before this will work:
>
>   $tw.utils.registerFileType("application/zip","base64",".zip");
>
>  I've commited ZIP support here:
>
>
> https://github.com/Jermolene/TiddlyWiki5/commit/a2493f80a973b24ad3d3affda945c437b98c2d2e
>
>  Best wishes
>
>  Jeremy.
>
>
>
>
>
>
> On Mon, Feb 23, 2015 at 9:35 AM, Stephan Hradek 
> wrote:
>
>>
>>
>> Am Montag, 23. Februar 2015 10:06:00 UTC+1 schrieb Andreas Hahn:
>>>
>>>  Yes, it is unfortunately it is the only way to do it, without editing
>>> core source code.
>>>
>>> I btw use powershell with a function I found online[1], that makes it
>>> kinda easy to do (since it even copies it to the clipboard).
>>>
>>
>> I think I have something similar for jEdit.
>>   --
>> You received this message because you are subscribed to the Google Groups
>> "TiddlyWiki" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to tiddlywiki+unsubscr...@googlegroups.com.
>> To post to this group, send email to tiddlywiki@googlegroups.com.
>> Visit this group at http://groups.google.com/group/tiddlywiki.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
>  --
> Jeremy Ruston
> mailto:jeremy.rus...@gmail.com
>  --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Andreas Hahn

Hi Jeremy,

thanks for the change in boot.js. I have a question though:

Wouldn't it be possible to handle all unkown MIME types as binary data ?
That would ensure that people could for example embed word or excel 
files or a bunch of other file types (at the expense of some txt/ascii 
based formats). I am not sure if that is a good idea, or if that is 
possible to implement since most other systems seem to access 
contentTypeInfo as hashmap.


/Andreas

Am 23.02.2015 um 11:58 schrieb Jeremy Ruston:

Hi Stephan

Just to be clear, TW5 does indeed support binary tiddlers (images 
being a good example). You can drag a ZIP file into TW and the right 
thing happens. The limitation at the moment is that there's no 
built-in way to download the file afterwards. You can use something 
like the following code to create a download link for a binary tiddler:


\define download-inner(title)
> 
download="download">Download "$title$"

\end

\define download(title)
<$set name="type" value={{$title$!!type}}>
<$set name="text" value={{$title$!!text}}>
<>


\end

<>

However, the .ZIP file extension needs to be registered in boot.js 
before this will work:


$tw.utils.registerFileType("application/zip","base64",".zip");

I've commited ZIP support here:

https://github.com/Jermolene/TiddlyWiki5/commit/a2493f80a973b24ad3d3affda945c437b98c2d2e

Best wishes

Jeremy.






On Mon, Feb 23, 2015 at 9:35 AM, Stephan Hradek 
mailto:stephan.hra...@gmail.com>> wrote:




Am Montag, 23. Februar 2015 10:06:00 UTC+1 schrieb Andreas Hahn:

Yes, it is unfortunately it is the only way to do it, without
editing core source code.

I btw use powershell with a function I found online[1], that
makes it kinda easy to do (since it even copies it to the
clipboard).


I think I have something similar for jEdit.
-- 
You received this message because you are subscribed to the Google

Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to tiddlywiki+unsubscr...@googlegroups.com
.
To post to this group, send email to tiddlywiki@googlegroups.com
.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.




--
Jeremy Ruston
mailto:jeremy.rus...@gmail.com 
--
You received this message because you are subscribed to the Google 
Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to tiddlywiki+unsubscr...@googlegroups.com 
.
To post to this group, send email to tiddlywiki@googlegroups.com 
.

Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Jeremy Ruston
Hi Stephan

Just to be clear, TW5 does indeed support binary tiddlers (images being a
good example). You can drag a ZIP file into TW and the right thing happens.
The limitation at the moment is that there's no built-in way to download
the file afterwards. You can use something like the following code to
create a download link for a binary tiddler:

\define download-inner(title)
>
download="download">Download "$title$"
\end

\define download(title)
<$set name="type" value={{$title$!!type}}>
<$set name="text" value={{$title$!!text}}>
<>


\end

<>

However, the .ZIP file extension needs to be registered in boot.js before
this will work:

$tw.utils.registerFileType("application/zip","base64",".zip");

I've commited ZIP support here:

https://github.com/Jermolene/TiddlyWiki5/commit/a2493f80a973b24ad3d3affda945c437b98c2d2e

Best wishes

Jeremy.






On Mon, Feb 23, 2015 at 9:35 AM, Stephan Hradek 
wrote:

>
>
> Am Montag, 23. Februar 2015 10:06:00 UTC+1 schrieb Andreas Hahn:
>>
>>  Yes, it is unfortunately it is the only way to do it, without editing
>> core source code.
>>
>> I btw use powershell with a function I found online[1], that makes it
>> kinda easy to do (since it even copies it to the clipboard).
>>
>
> I think I have something similar for jEdit.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to tiddlywiki+unsubscr...@googlegroups.com.
> To post to this group, send email to tiddlywiki@googlegroups.com.
> Visit this group at http://groups.google.com/group/tiddlywiki.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jeremy Ruston
mailto:jeremy.rus...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Stephan Hradek


Am Montag, 23. Februar 2015 10:06:00 UTC+1 schrieb Andreas Hahn:
>
>  Yes, it is unfortunately it is the only way to do it, without editing 
> core source code.
>
> I btw use powershell with a function I found online[1], that makes it 
> kinda easy to do (since it even copies it to the clipboard).
>

I think I have something similar for jEdit. 

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Andreas Hahn
Yes, it is unfortunately it is the only way to do it, without editing 
core source code.


I btw use powershell with a function I found online[1], that makes it 
kinda easy to do (since it even copies it to the clipboard).


/Andreas

[1] 
https://mnaoumov.wordpress.com/2013/06/20/how-to-reach-unreachable-or-copy-files-to-rdp/


Am 23.02.2015 um 10:01 schrieb Stephan Hradek:
Thanks Andreas - So Mario is right with his hint that I need to 
convert to base 64.

--
You received this message because you are subscribed to the Google 
Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to tiddlywiki+unsubscr...@googlegroups.com 
.
To post to this group, send email to tiddlywiki@googlegroups.com 
.

Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Stephan Hradek
Thanks Andreas - So Mario is right with his hint that I need to convert to 
base 64.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: Embed a ZIP for download?

2015-02-23 Thread Andreas Hahn

Hey Stephan,

at the moment TW is incapable of handling binary files (i.e. zip files). 
Unless you want to make big changes to various parts of the core, I 
suggest you do the following:


1. Convert your .zip into a base64 string
2. Place it inside a plain text tiddler (for reference)
3. Place a specially crafted link pointing to the url: 
"data:application/zip;base64,"


That should initiate a file dowload onClick is is currently the easiest 
way of doing it. Of course you can imagine writing a widget that reads 
the tiddler and crafts such a link,
clicks it and removes the link (that is how the download saver does it), 
but you can manually craft the link as well.


/Andreas

--
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.