This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-07-24 22:22:06

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Squeak FTP

Does anyone know of a way I can upload a file via FTP from Squeak?

(I am tired of using an AutoIT script as the Insanity uploader).


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#2 2012-07-24 22:34:01

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Squeak FTP

HTTP post?


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#3 2012-07-24 22:39:02

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

MathWizz wrote:

HTTP post?

If possible, I'd like to avoid that.

(On pretty much every web host I can find, they have relatively small POST limits)


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#4 2012-07-24 22:46:15

MathWizz
Scratcher
Registered: 2009-08-31
Posts: 1000+

Re: Squeak FTP

jvvg wrote:

MathWizz wrote:

HTTP post?

If possible, I'd like to avoid that.

(On pretty much every web host I can find, they have relatively small POST limits)

Ah. I don't have any other idea though...  hmm


http://block.site90.net/scratch.mit/text.php?size=30&text=%20A%20signature!&color=333333

Offline

 

#5 2012-07-25 00:18:34

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Squeak FTP

I don't know of many ways. I'd look around in the class HTTPSocket.

Offline

 

#6 2012-07-25 13:58:15

lallaway12
Scratcher
Registered: 2012-01-04
Posts: 500+

Re: Squeak FTP

Look in the scratch sorce


http://i49.tinypic.com/2re4ied.png

Offline

 

#7 2012-07-25 14:02:39

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Squeak FTP

lallaway12 wrote:

Look in the scratch sorce

... He said he was tired of using the autoIT script and he wanted to do it in Squeak, or in the source code ...

Offline

 

#8 2012-07-25 16:33:19

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Squeak FTP

Write one...


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#9 2012-07-25 16:50:21

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Squeak FTP

jvvg wrote:

MathWizz wrote:

HTTP post?

If possible, I'd like to avoid that.

(On pretty much every web host I can find, they have relatively small POST limits)

However, aside from external applications, it may be the safest way.
After all, Insanity  (i bet that's what you're gonna use it for  wink  ) is open source, so if you put ftp details in a scratch mod, someone could decompile it and find them.

The only other way i can think of is to have it upload to a "temp" website, and then the program sends a signal to the main website, which then pulls the project from the temp website without compromising any sensitive info besides the temp site ftp account, which shouldn't matter if that is the only thing on there.

Another option I haven't heard much about is HTTP PUT.  I don't know the exact details of that though....

Last edited by SJRCS_011 (2012-07-25 19:18:08)


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#10 2012-07-25 17:36:33

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

SJRCS_011 wrote:

jvvg wrote:

MathWizz wrote:

HTTP post?

If possible, I'd like to avoid that.

(On pretty much every web host I can find, they have relatively small POST limits)

However, aside from external applications, it may be the safest way.
After all, Insanity  (i bet that's what you're gonna use it for  wink ) is open source, so if you put ftp details in a scratch mod, someone could decompile it and find them.

The only other way i can think of is to have it upload to a "temp" website, and then the program sends a signal to the main website, which then pulls the project from the temp website without compromising any sensitive info besides the temp site ftp account, which shouldn't matter if that is the only thing on there.

Another option I haven't heard much about is HTTP PUT.  I don't know the exact details of that though....

Yeah, I was going to use a temp site.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#11 2012-07-25 17:54:55

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Squeak FTP

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#12 2012-07-25 18:28:07

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

GP1 wrote:

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.

The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#13 2012-07-25 19:25:21

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Squeak FTP

jvvg wrote:

GP1 wrote:

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.

The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).

but i bet scratchr.org still has a limit.


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#14 2012-07-25 21:03:09

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

SJRCS_011 wrote:

jvvg wrote:

GP1 wrote:

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.

The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).

but i bet scratchr.org still has a limit.

Yes, but it is probably bigger.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#15 2012-07-26 12:59:55

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Squeak FTP

jvvg wrote:

GP1 wrote:

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.

The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).

But my theoretic method isnt uploading anything. Your writing a file, not uploading a file. However, your host might have a limit to how big you can write your files (although that would seem silly)


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#16 2012-07-26 13:25:00

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

GP1 wrote:

jvvg wrote:

GP1 wrote:

I don't know how secure this would be, but you could have a PHP script on your server:

Code:

<?php
$fp = fopen("test.sb", "w");
fwrite($_REQUEST['fcontents'], $fp);
fclose($fp);
?>

Then in Squeak you would send data (GET or POST, wouldn't matter but POST allows more data via http) to that script, with a parameter fcontents. The parameter would hold the file contents (still in binary form). Well, that's theoretic, I've never tried it.

The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).

But my theoretic method isnt uploading anything. Your writing a file, not uploading a file. However, your host might have a limit to how big you can write your files (although that would seem silly)

I think that the only limiting factor for the uploader is POST limits.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#17 2012-07-26 19:24:06

GP1
Scratcher
Registered: 2009-07-06
Posts: 1000+

Re: Squeak FTP

jvvg wrote:

GP1 wrote:

jvvg wrote:


The problem is that the web host I use has a limit on how big an uploaded file can be and how long it can take to upload it (8MB and 30 seconds). Because of that, I would need FTP (unless we move Mod Share to ScratchR.org).

But my theoretic method isnt uploading anything. Your writing a file, not uploading a file. However, your host might have a limit to how big you can write your files (although that would seem silly)

I think that the only limiting factor for the uploader is POST limits.

I think only GET has a limit.


I am currently http://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=imagehttp://blocks.scratchr.org/API.php?user=GP1&amp;action=onlineStatus&amp;type=text and I finally got over 1000 posts.

Offline

 

#18 2012-07-26 20:22:38

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Squeak FTP

GP1 wrote:

jvvg wrote:

GP1 wrote:


But my theoretic method isnt uploading anything. Your writing a file, not uploading a file. However, your host might have a limit to how big you can write your files (although that would seem silly)

I think that the only limiting factor for the uploader is POST limits.

I think only GET has a limit.

Only on the server.

I looked at the server configuration, and it also has the following values in it:
upload_max_filesize (8MB, limit for files submitted)
post_maxsize (1MB or so, limit on POST data that is not files)
max_execution_input_time (or something like that, 30 seconds, which means that if an upload takes longer than 30 seconds, connection is cut off)


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

Board footer