Re: On-Rev File Browser Upload Dialog

2010-10-21 Thread Jim Ault

On Oct 20, 2010, at 9:51 PM, Rick Harrison wrote:


Andre,

I'm just a little surprised that with as powerful as Rev is,
we are still forced to use the older solutions.

Thanks for the clarification anyway.



Rick

I am not sure what you mean by 'older solutions'.
RevServer is bound by the features and functions of browsers and the  
standards that they follow.  The newest standards are HTML5, CSS3,  
etc.  This is how browsers operate.  Microsoft has done the experiment  
of deviating from such standards, teaching us that this is not a good  
long term strategy.


On the desktop app/exe side, programmers are free to create their own  
protocols, interfaces, and functions.  In that case, the marketplace  
will choose the 'winners'.


Jim Ault
Las Vegas




On Oct 20, 2010, at 3:45 PM, Andre Garzia wrote:


Rick,

There is no way around this.

RevServer is not like the desktop engine, there is no GUI. Actually  
the

whole web is like this, you communicate using stateless transactions
exchanging what is basically text. What you do is send a form to  
the browser
with the correct encoding and inputs and then you decode back this  
form.


check out a little document on the web called HTTP made really  
easy to
understand more about the underlining protocol and then check out  
w3schools

website on HTML, CSS and Javascript.

With the clear picture in mind, check out the MVC paradigm which is  
the one
that maps better to RevServer with HTML/CSS/JS being the View and  
RevServer,

the controller

On Wed, Oct 20, 2010 at 5:34 PM, Rick Harrison harri...@all-auctions.com 
wrote:



Hi Matthias,

This is an interesting solution.  It uses a combination
of javascript, irev, etc..  I installed the code, and it doesn't
want to work just yet.  It's telling me that the form isn't
supported.

Looks like it will only work with a multi-part form?
I'll make one and try it again.

Any more documentation on this solution?

Anything solution using pure irev  or that's a little more simple  
out

there?

Thanks,

Rick


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-21 Thread Rick Harrison
Hi Jim,

All I meant was that RevServer is the relatively new kid 
on the block, and I had hoped that it had the capability 
within it without relying on externals code such as 
java-script to get the job done in an easier way.

I understand that it is bound by browser protocols, and
that it needs to operate in accordance with the standards.

Rick

On Oct 21, 2010, at 11:30 AM, Jim Ault wrote:
 
 Rick
 
 I am not sure what you mean by 'older solutions'.
 RevServer is bound by the features and functions of browsers and the 
 standards that they follow.  The newest standards are HTML5, CSS3, etc.  This 
 is how browsers operate.  Microsoft has done the experiment of deviating from 
 such standards, teaching us that this is not a good long term strategy.
 
 On the desktop app/exe side, programmers are free to create their own 
 protocols, interfaces, and functions.  In that case, the marketplace will 
 choose the 'winners'.
 
 Jim Ault
 Las Vegas
 

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-21 Thread Richard Gaskin

Rick Harrison wrote:


All I meant was that RevServer is the relatively new kid
on the block, and I had hoped that it had the capability
within it without relying on externals code such as
java-script to get the job done in an easier way.


But in this case you're looking for oranges in an apple barrel:

RevServer runs on the server.  It can do a lot there, and many very 
interesting apps can be written natively in LiveCode without anything 
else at all.


That is, to the extent that the server side contributes to a 
client-server application.


That leaves the client side to be addressed, where your question was 
about the user interface for selecting a file.


On the client we have no choice:  the only scripting engine built into 
browsers is JavaScript.  That's it.  The good thing about that is you 
don't need to spend a lot of time deciding which language to use to make 
your client-side UIs, since you have no choice in the matter at all. :)


I suppose you could use the RevWeb plugin, but for all but a fairly 
limited subset of sites in which you have an unusually committed 
audience, downloading any plugin is a non-starter.


Earlier you found the input object to provide that for the user:
input type=file class=upload name=fileX[]

Use that in an HTML form and you're good to go.  Here's the relevant 
part of the HTML source from the page I use at my site for uploading files:


form enctype=multipart/form-data action=/cgi-t/mydropbox.cgi 
method=post

Send this file:
input type=file name=userfile
input type=submit value=Send File
input type=hidden name=email value=drop...@fourthworld.com
/form


Now you're left with the server side, where the uploaded data will come 
in as part of a multi-part form.


I believe the code for parsing that from the incoming data stream so you 
can write it to disk has already been provided by Mattias, in 
RevServer-ready LiveCode:


http://mail.runrev.com/pipermail/use-revolution/2010-October/147067.html

So now you have both the client and the server side parts you need.

Nothing left but to glue them together and enjoy. :)

--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-21 Thread Matthias Rebbe
Richard,

i see in your example that you are submitting the form to mydropbox.cgi. Is 
this cgi made in rev?
and if so, would you share it?

Regards,

Matthias
Am 21.10.2010 um 18:07 schrieb Richard Gaskin:
 
 form enctype=multipart/form-data action=/cgi-t/mydropbox.cgi 
 method=post
 Send this file:
 input type=file name=userfile
 input type=submit value=Send File
 input type=hidden name=email value=drop...@fourthworld.com
 /form

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-21 Thread Richard Gaskin

Matthias Rebbe wrote:

i see in your example that you are submitting the form to mydropbox.cgi. Is 
this cgi made in rev?
and if so, would you share it?


That particular CGI is written in Perl, but copied below is an early 
draft of one I've been working on for RevCloud.


Note that it's very much an early draft and hasn't had much testing, and 
that it's designed only to parse the multi-part form data into a 
memory-based array for other functions to write out to disk if needed, 
so while it's held up okay when sending files of a few MBs it doesn't 
provide asynchronous feedback and isn't suitable for really large files 
like videos.  I would be grateful if someone had a more robust 
asynchronous solution they could share.




on _cgiGetInput
  if $REQUEST_METHOD is POST then
-- POST: -
put empty into tBuffer
repeat until length(tBuffer) = $CONTENT_LENGTH
  read from stdin until empty
  put it after tBuffer
end repeat
if tBuffer is empty then put $QUERY_STRING into tBuffer
--
if char 1 to 30 of $CONTENT_TYPE = multipart/form-data; boundary= 
then

  -- MULTI-PART FORM:
  put $CONTENT_TYPE into tMimeBoundary
  delete char 1 to 30 of tMimeBoundary
  if char 1 of tMimeBoundary = quote then delete char 1 of 
tMimeBoundary
  if last char of tMimeBoundary = quote then delete last char of 
tMimeBoundary

  --
  repeat
-- Get next part:
put lineoffset(tMimeBoundary, tBuffer) into  tStart
if tStart = 0 then exit repeat
delete line 1 to tStart of tBuffer
put lineoffset(tMimeBoundary, tBuffer) into tEnd
if tEnd = 0 then exit repeat
put line 1 to (tEnd-1) of tBuffer into tPartData
delete last char of tPartData -- trailing CR
--
-- Parse part:
put line 1 of tPartData into tInfo
set the itemdel to ;
put item 2 of tInfo into tName
delete char 1 to 7 of tName
delete last char of tName
if last char of tName  = quote then delete last char of tName
--
put empty into tFileName
if (the number of items of tInfo = 3) \
AND (char 1 to 10 of item 3 of tInfo =  filename=) then
  -- file data:
  put item 3 of tInfo into tFileName
  delete char 1 to 11 of tFileName
  delete last char of tFileName
  if last char of tFileName  = quote then delete last char of 
tFileName

  --
  # put tFileName into gCGIFileNamesA[tName]

end if
-- get raw data:
if char 1 to 13 of line 2 of tPartData = Content-Type: then
  delete line 1 to 3 of tPartData
else
  delete line 1 to 2 of tPartData
end if
if tFileName is empty then
  put tPartData into gCGIDataInA[tName]
else
  put tPartData into gCGIDataInA[file:tFileName]
end if
  end repeat
  --
else
  -- NORMAL FORM:
  put tBuffer into gCGIDataInA
  split gCGIDataInA  by  and =
  repeat for each line tKey in the keys of gCGIDataInA
put URLDecode(gCGIDataInA[tKey]) into gCGIDataInA[tKey]
  end repeat
end if
--
  else
-- GET: -
put $QUERY_STRING into gCGIDataInA
split gCGIDataInA by  and =
repeat for each line tKey in the keys of gCGIDataInA
  put urlDecode(gCGIDataInA[tKey]) into gCGIDataInA[tKey]
end repeat
  end if
end _cgiGetInput


--
 Richard Gaskin
 Fourth World
 LiveCode training and consulting: http://www.fourthworld.com
 Webzine for LiveCode developers: http://www.LiveCodeJournal.com
 LiveCode Journal blog: http://LiveCodejournal.com/blog.irv

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


On-Rev File Browser Upload Dialog

2010-10-20 Thread Rick Harrison
I really don't want to re-invent the wheel today.

How can I get a simple file browser upload dialog
to upload a file using an irev script located at On-Rev.

I understand that I'll probably be using 
libURLftpUploadFile for this.

If this were just a stack I'd be using:

answer file Please choose the file to upload

to generate the dialog.  As I understand it, 'answer'
just doesn't work for irev scripts.

This seems like such a basic need, that I can't
imagine that no one has done this before.

If you have any example code, that would be excellent.

Thanks in advance!

Rick
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-20 Thread Matthias Rebbe
Hi Rick,

there was something similiar by Magix. 

Please find the example at the following url.

http://matthiasrebbe.eu/on-rev/upld-1.0.zip

hth,

Matthias


Am 20.10.2010 um 17:08 schrieb Rick Harrison:

 I really don't want to re-invent the wheel today.
 
 How can I get a simple file browser upload dialog
 to upload a file using an irev script located at On-Rev.
 
 I understand that I'll probably be using 
 libURLftpUploadFile for this.
 
 If this were just a stack I'd be using:
 
 answer file Please choose the file to upload
 
 to generate the dialog.  As I understand it, 'answer'
 just doesn't work for irev scripts.
 
 This seems like such a basic need, that I can't
 imagine that no one has done this before.
 
 If you have any example code, that would be excellent.
 
 Thanks in advance!
 
 Rick
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-20 Thread Rick Harrison
Hi Matthias,

This is an interesting solution.  It uses a combination
of javascript, irev, etc..  I installed the code, and it doesn't
want to work just yet.  It's telling me that the form isn't
supported.  

Looks like it will only work with a multi-part form?
I'll make one and try it again. 

Any more documentation on this solution?

Anything solution using pure irev  or that's a little more simple out there?

Thanks,

Rick

On Oct 20, 2010, at 12:11 PM, Matthias Rebbe wrote:

 Hi Rick,
 
 there was something similiar by Magix. 
 
 Please find the example at the following url.
 
 http://matthiasrebbe.eu/on-rev/upld-1.0.zip
 
 hth,
 
 Matthias
 
 
 Am 20.10.2010 um 17:08 schrieb Rick Harrison:
 
 I really don't want to re-invent the wheel today.
 
 How can I get a simple file browser upload dialog
 to upload a file using an irev script located at On-Rev.
 
 I understand that I'll probably be using 
 libURLftpUploadFile for this.
 
 If this were just a stack I'd be using:
 
 answer file Please choose the file to upload
 
 to generate the dialog.  As I understand it, 'answer'
 just doesn't work for irev scripts.
 
 This seems like such a basic need, that I can't
 imagine that no one has done this before.
 
 If you have any example code, that would be excellent.
 
 Thanks in advance!
 
 Rick
 



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-20 Thread Andre Garzia
Rick,

There is no way around this.

RevServer is not like the desktop engine, there is no GUI. Actually the
whole web is like this, you communicate using stateless transactions
exchanging what is basically text. What you do is send a form to the browser
with the correct encoding and inputs and then you decode back this form.

check out a little document on the web called HTTP made really easy to
understand more about the underlining protocol and then check out w3schools
website on HTML, CSS and Javascript.

With the clear picture in mind, check out the MVC paradigm which is the one
that maps better to RevServer with HTML/CSS/JS being the View and RevServer,
the controller

On Wed, Oct 20, 2010 at 5:34 PM, Rick Harrison harri...@all-auctions.comwrote:

 Hi Matthias,

 This is an interesting solution.  It uses a combination
 of javascript, irev, etc..  I installed the code, and it doesn't
 want to work just yet.  It's telling me that the form isn't
 supported.

 Looks like it will only work with a multi-part form?
 I'll make one and try it again.

 Any more documentation on this solution?

 Anything solution using pure irev  or that's a little more simple out
 there?

 Thanks,

 Rick

 On Oct 20, 2010, at 12:11 PM, Matthias Rebbe wrote:

  Hi Rick,
 
  there was something similiar by Magix.
 
  Please find the example at the following url.
 
  http://matthiasrebbe.eu/on-rev/upld-1.0.zip
 
  hth,
 
  Matthias
 
 
  Am 20.10.2010 um 17:08 schrieb Rick Harrison:
 
  I really don't want to re-invent the wheel today.
 
  How can I get a simple file browser upload dialog
  to upload a file using an irev script located at On-Rev.
 
  I understand that I'll probably be using
  libURLftpUploadFile for this.
 
  If this were just a stack I'd be using:
 
  answer file Please choose the file to upload
 
  to generate the dialog.  As I understand it, 'answer'
  just doesn't work for irev scripts.
 
  This seems like such a basic need, that I can't
  imagine that no one has done this before.
 
  If you have any example code, that would be excellent.
 
  Thanks in advance!
 
  Rick
 



 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-20 Thread Bob Sneidar
HELP Mr. Wizard HELP!!! I don't wanna be a web developer anymore!!!

Bob


On Oct 20, 2010, at 12:45 PM, Andre Garzia wrote:

 Rick,
 
 There is no way around this.
 
 RevServer is not like the desktop engine, there is no GUI. Actually the
 whole web is like this, you communicate using stateless transactions
 exchanging what is basically text. What you do is send a form to the browser
 with the correct encoding and inputs and then you decode back this form.
 
 check out a little document on the web called HTTP made really easy to
 understand more about the underlining protocol and then check out w3schools
 website on HTML, CSS and Javascript.
 
 With the clear picture in mind, check out the MVC paradigm which is the one
 that maps better to RevServer with HTML/CSS/JS being the View and RevServer,
 the controller

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: On-Rev File Browser Upload Dialog

2010-10-20 Thread Rick Harrison
Andre,

I'm just a little surprised that with as powerful as Rev is,
we are still forced to use the older solutions.

Thanks for the clarification anyway.

Rick

On Oct 20, 2010, at 3:45 PM, Andre Garzia wrote:

 Rick,
 
 There is no way around this.
 
 RevServer is not like the desktop engine, there is no GUI. Actually the
 whole web is like this, you communicate using stateless transactions
 exchanging what is basically text. What you do is send a form to the browser
 with the correct encoding and inputs and then you decode back this form.
 
 check out a little document on the web called HTTP made really easy to
 understand more about the underlining protocol and then check out w3schools
 website on HTML, CSS and Javascript.
 
 With the clear picture in mind, check out the MVC paradigm which is the one
 that maps better to RevServer with HTML/CSS/JS being the View and RevServer,
 the controller
 
 On Wed, Oct 20, 2010 at 5:34 PM, Rick Harrison 
 harri...@all-auctions.comwrote:
 
 Hi Matthias,
 
 This is an interesting solution.  It uses a combination
 of javascript, irev, etc..  I installed the code, and it doesn't
 want to work just yet.  It's telling me that the form isn't
 supported.
 
 Looks like it will only work with a multi-part form?
 I'll make one and try it again.
 
 Any more documentation on this solution?
 
 Anything solution using pure irev  or that's a little more simple out
 there?
 
 Thanks,
 
 Rick
 
 On Oct 20, 2010, at 12:11 PM, Matthias Rebbe wrote:
 
 Hi Rick,
 
 there was something similiar by Magix.
 
 Please find the example at the following url.
 
 http://matthiasrebbe.eu/on-rev/upld-1.0.zip
 
 hth,
 
 Matthias
 
 
 Am 20.10.2010 um 17:08 schrieb Rick Harrison:
 
 I really don't want to re-invent the wheel today.
 
 How can I get a simple file browser upload dialog
 to upload a file using an irev script located at On-Rev.
 
 I understand that I'll probably be using
 libURLftpUploadFile for this.
 
 If this were just a stack I'd be using:
 
 answer file Please choose the file to upload
 
 to generate the dialog.  As I understand it, 'answer'
 just doesn't work for irev scripts.
 
 This seems like such a basic need, that I can't
 imagine that no one has done this before.
 
 If you have any example code, that would be excellent.
 
 Thanks in advance!
 
 Rick
 
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 
 -- 
 http://www.andregarzia.com All We Do Is Code.
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

__
Rick Harrison

You can buy my $10 music album Funny Time Machine digital CD on the iTunes 
Store Now!

To visit the iTunes Store now to listen to samples of my CD please click on the
following link.  (Please note you must have iTunes installed on your computer 
for this link to work.)  

http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewAlbum?playListId=213668290


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution