ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 11 Jan 2012 16:21:40 +0100Large worksheet upload to notebookhttps://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/ It has been a problem to upload the large single worksheet files or archives to Sage Notebook server for quite a long time (see for example [this](http://groups.google.com/group/sage-support/browse_thread/thread/727843a963c78fb3) and [this](http://groups.google.com/group/sage-support/browse_thread/thread/cd665950c28dc5c5/) mailing list threads) and seems to have no comprehensive answer or recipe.
I found a simple solution to the problem of uploading large files to the local Sage Notebook server (running on my own PC). Here it is:
Let's assume we downloaded a large (about 30 MB) single *"MyWorksheet.sws"* file from some remote Sage Notebook server in order to add it to our local one, and put it into the *"Downloads"* folder.
First of all we need to unpack this file. Since the ***.sws*** files are actually the ***.tar.bz2*** archives, we can simply do the following
tar -xvf MyWorksheet.sws
which gives us a directory named **"sage_worksheet"** which contains all the worksheet stuff.
Next we should go to the directory
/home/system_user_name/.sage/sage_notebook.sagenb/home/sage_user_name
where the "system_user_name" is a name we use to login (assuming that we start our local Sage Notebook server from this account also) and "sage_user_name" is a name of the user account we want to add the *"MyWorksheet"* worksheet to.
There should be some catalogs named consequently **"1"**, **"2"**, **"3"**, ... in this directory. We need to find the biggest number (let's assume it will be "41") and create an empty catalog with the name larger by one ("42" in our example).
mkdir 42
Next we have to move all the contents from the unpacked *"sage_worksheet"* directory to this newly created one:
mv -t 42/ ~/Downloads/sage_worksheet/*
Let's check what we have now:
ls 42
If everything is done correctly, we shoul see something like this:
cells worksheet.html worksheet.txt worksheet_conf.pickle
Now we can (re)start our local Sage Notebook server, log in and see that the ***MyWorksheet*** is there in the worksheets list.
Mon, 05 Dec 2011 14:30:46 +0100https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/Comment by Jason Grout for <p>It has been a problem to upload the large single worksheet files or archives to Sage Notebook server for quite a long time (see for example <a href="http://groups.google.com/group/sage-support/browse_thread/thread/727843a963c78fb3">this</a> and <a href="http://groups.google.com/group/sage-support/browse_thread/thread/cd665950c28dc5c5/">this</a> mailing list threads) and seems to have no comprehensive answer or recipe.</p>
<p>I found a simple solution to the problem of uploading large files to the local Sage Notebook server (running on my own PC). Here it is:</p>
<p>Let's assume we downloaded a large (about 30 MB) single <em>"MyWorksheet.sws"</em> file from some remote Sage Notebook server in order to add it to our local one, and put it into the <em>"Downloads"</em> folder.</p>
<p>First of all we need to unpack this file. Since the <strong><em>.sws</em></strong> files are actually the <strong><em>.tar.bz2</em></strong> archives, we can simply do the following</p>
<pre><code>tar -xvf MyWorksheet.sws
</code></pre>
<p>which gives us a directory named <strong>"sage_worksheet"</strong> which contains all the worksheet stuff.</p>
<p>Next we should go to the directory</p>
<pre><code>/home/system_user_name/.sage/sage_notebook.sagenb/home/sage_user_name
</code></pre>
<p>where the "system_user_name" is a name we use to login (assuming that we start our local Sage Notebook server from this account also) and "sage_user_name" is a name of the user account we want to add the <em>"MyWorksheet"</em> worksheet to.</p>
<p>There should be some catalogs named consequently <strong>"1"</strong>, <strong>"2"</strong>, <strong>"3"</strong>, ... in this directory. We need to find the biggest number (let's assume it will be "41") and create an empty catalog with the name larger by one ("42" in our example).</p>
<pre><code>mkdir 42
</code></pre>
<p>Next we have to move all the contents from the unpacked <em>"sage_worksheet"</em> directory to this newly created one:</p>
<pre><code>mv -t 42/ ~/Downloads/sage_worksheet/*
</code></pre>
<p>Let's check what we have now:</p>
<pre><code>ls 42
</code></pre>
<p>If everything is done correctly, we shoul see something like this:</p>
<pre><code>cells worksheet.html worksheet.txt worksheet_conf.pickle
</code></pre>
<p>Now we can (re)start our local Sage Notebook server, log in and see that the <strong><em>MyWorksheet</em></strong> is there in the worksheets list.</p>
https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?comment=20755#post-id-20755I think you've just described what the sage server does to unpack and install an uploaded .sws file. Good job!Mon, 05 Dec 2011 17:04:30 +0100https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?comment=20755#post-id-20755Comment by kcrisman for <p>It has been a problem to upload the large single worksheet files or archives to Sage Notebook server for quite a long time (see for example <a href="http://groups.google.com/group/sage-support/browse_thread/thread/727843a963c78fb3">this</a> and <a href="http://groups.google.com/group/sage-support/browse_thread/thread/cd665950c28dc5c5/">this</a> mailing list threads) and seems to have no comprehensive answer or recipe.</p>
<p>I found a simple solution to the problem of uploading large files to the local Sage Notebook server (running on my own PC). Here it is:</p>
<p>Let's assume we downloaded a large (about 30 MB) single <em>"MyWorksheet.sws"</em> file from some remote Sage Notebook server in order to add it to our local one, and put it into the <em>"Downloads"</em> folder.</p>
<p>First of all we need to unpack this file. Since the <strong><em>.sws</em></strong> files are actually the <strong><em>.tar.bz2</em></strong> archives, we can simply do the following</p>
<pre><code>tar -xvf MyWorksheet.sws
</code></pre>
<p>which gives us a directory named <strong>"sage_worksheet"</strong> which contains all the worksheet stuff.</p>
<p>Next we should go to the directory</p>
<pre><code>/home/system_user_name/.sage/sage_notebook.sagenb/home/sage_user_name
</code></pre>
<p>where the "system_user_name" is a name we use to login (assuming that we start our local Sage Notebook server from this account also) and "sage_user_name" is a name of the user account we want to add the <em>"MyWorksheet"</em> worksheet to.</p>
<p>There should be some catalogs named consequently <strong>"1"</strong>, <strong>"2"</strong>, <strong>"3"</strong>, ... in this directory. We need to find the biggest number (let's assume it will be "41") and create an empty catalog with the name larger by one ("42" in our example).</p>
<pre><code>mkdir 42
</code></pre>
<p>Next we have to move all the contents from the unpacked <em>"sage_worksheet"</em> directory to this newly created one:</p>
<pre><code>mv -t 42/ ~/Downloads/sage_worksheet/*
</code></pre>
<p>Let's check what we have now:</p>
<pre><code>ls 42
</code></pre>
<p>If everything is done correctly, we shoul see something like this:</p>
<pre><code>cells worksheet.html worksheet.txt worksheet_conf.pickle
</code></pre>
<p>Now we can (re)start our local Sage Notebook server, log in and see that the <strong><em>MyWorksheet</em></strong> is there in the worksheets list.</p>
https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?comment=20748#post-id-20748But Jason, is there a way to get this to always work? It sounds like v_2e is suggesting this doesn't actually always happen.Tue, 06 Dec 2011 09:21:03 +0100https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?comment=20748#post-id-20748Answer by v_2e for <p>It has been a problem to upload the large single worksheet files or archives to Sage Notebook server for quite a long time (see for example <a href="http://groups.google.com/group/sage-support/browse_thread/thread/727843a963c78fb3">this</a> and <a href="http://groups.google.com/group/sage-support/browse_thread/thread/cd665950c28dc5c5/">this</a> mailing list threads) and seems to have no comprehensive answer or recipe.</p>
<p>I found a simple solution to the problem of uploading large files to the local Sage Notebook server (running on my own PC). Here it is:</p>
<p>Let's assume we downloaded a large (about 30 MB) single <em>"MyWorksheet.sws"</em> file from some remote Sage Notebook server in order to add it to our local one, and put it into the <em>"Downloads"</em> folder.</p>
<p>First of all we need to unpack this file. Since the <strong><em>.sws</em></strong> files are actually the <strong><em>.tar.bz2</em></strong> archives, we can simply do the following</p>
<pre><code>tar -xvf MyWorksheet.sws
</code></pre>
<p>which gives us a directory named <strong>"sage_worksheet"</strong> which contains all the worksheet stuff.</p>
<p>Next we should go to the directory</p>
<pre><code>/home/system_user_name/.sage/sage_notebook.sagenb/home/sage_user_name
</code></pre>
<p>where the "system_user_name" is a name we use to login (assuming that we start our local Sage Notebook server from this account also) and "sage_user_name" is a name of the user account we want to add the <em>"MyWorksheet"</em> worksheet to.</p>
<p>There should be some catalogs named consequently <strong>"1"</strong>, <strong>"2"</strong>, <strong>"3"</strong>, ... in this directory. We need to find the biggest number (let's assume it will be "41") and create an empty catalog with the name larger by one ("42" in our example).</p>
<pre><code>mkdir 42
</code></pre>
<p>Next we have to move all the contents from the unpacked <em>"sage_worksheet"</em> directory to this newly created one:</p>
<pre><code>mv -t 42/ ~/Downloads/sage_worksheet/*
</code></pre>
<p>Let's check what we have now:</p>
<pre><code>ls 42
</code></pre>
<p>If everything is done correctly, we shoul see something like this:</p>
<pre><code>cells worksheet.html worksheet.txt worksheet_conf.pickle
</code></pre>
<p>Now we can (re)start our local Sage Notebook server, log in and see that the <strong><em>MyWorksheet</em></strong> is there in the worksheets list.</p>
https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?answer=13113#post-id-13113 Hello!
The problem is that the "solustion" described above is valid only for "Remote Server --> Local Server" transfers in general case.
What about uploading from the home PC to a remote server? In this case the user usually does not have the necessary permissions to write to the arbitrary files on the server, and the Notebook's upload functionality seems to be the only working solution, which unfortunately does not work for large files.Wed, 11 Jan 2012 16:21:40 +0100https://ask.sagemath.org/question/8530/large-worksheet-upload-to-notebook/?answer=13113#post-id-13113