lasso 9.3.1.x > upload files > basic steps

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

lasso 9.3.1.x > upload files > basic steps

XL Cordemans
Is there somewhere a guide for "dummies" for  uploading files ? 
This is the set-up we have:- mac os X El Capitan (10.11.6)- lasso 9.3.1 (  )- Apache webserver- Mysql
The questions:
- folder permissions?- user settings?- path settings (I want it in the directory-folder manuals  */manuals/ )
For testing I partially copied the code set by Jolle CarleStam in Jan this year and adapted it a bit. After  trying to upload the file test.txt this is what I get - BUT the file is nowhere to be seen ... !? 
No error array (staticarray((contenttype = text/plain), (fieldname = upfile), (filename = test.txt), (tmpfilename = //tmp/lassomsbOyj71207157.uld), (filesize = 20291)))

The Code is here below:

    [File_CurrentError]    [local( upload = web_request -> fileuploads, file_subject = 'test' )]
    <!DOCTYPE html>    <html lang="en">    <head>    <title>File upload test</title>    </head>    <body>    <form action="test_upload.lasso" method="post" enctype="multipart/form-data">    <input type="text" name="subject" value=""><br>    <input type=file name="upfile"><br>    <input type=submit value="submit">    </form>
<hr>

Thank you







#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9.3.1.x > upload files > basic steps

Jolle Carlestam-2
2016-09-06 04:38 skrev XL Cordemans:

> Is there somewhere a guide for "dummies" for  uploading files ? 
> This is the set-up we have:- mac os X El Capitan (10.11.6)- lasso
> 9.3.1 (  )- Apache webserver- Mysql
> The questions:
> - folder permissions?- user settings?- path settings (I want it in the
> directory-folder manuals  */manuals/ )
> For testing I partially copied the code set by Jolle CarleStam in Jan
> this year and adapted it a bit. After  trying to upload the file
> test.txt this is what I get - BUT the file is nowhere to be seen ...
> !? 
> No error array (staticarray((contenttype = text/plain), (fieldname =
> upfile), (filename = test.txt), (tmpfilename =
> //tmp/lassomsbOyj71207157.uld), (filesize = 20291)))
>
> The Code is here below:
>
>     [File_CurrentError]    [local( upload = web_request ->
> fileuploads, file_subject = 'test' )]
>     <!DOCTYPE html>    <html lang="en">    <head>    <title>File
> upload test</title>    </head>    <body>    <form
> action="test_upload.lasso" method="post"
> enctype="multipart/form-data">    <input type="text" name="subject"
> value=""><br>    <input type=file name="upfile"><br>    <input
> type=submit value="submit">    </form>
> <hr>
>
> Thank you


Copy my code without using it? What's the point? :-)

Here's my suggested steps.

Grab the actual type from here:
https://gist.github.com/jolle-c/9957187

Make sure it's installed in a proper place.

Make sure Lasso can write to the directory you want your files in. Using
Terminal is the best place for this.

Navigate to the directory, you do this using su.

cd /path/to/site/manuals

Then set the permissions.

sudo chown -R _lasso:_lasso *
sudo chmod og+w

With this in place next step is to write your code. I don't agree on
your setup to have both code to handle the file upload and present the
upload html in the same place but that's not a showstopper.

Wherever you want to handle the upload. write this:

local(uploadfile = jc_fileuploads(1)) // the integer is optional and
will if provided restrict the method to the n:th count of uploaded files

#myfile -> save('/manuals/' + #myfile -> fieldname)

That should do it. NB I am on a trip and don't have access to my work
setup so the code is untested.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9.3.1.x > upload files > basic steps

XL Cordemans
Thank you Jolle for the explanation.
Nice script.
Getting something to work, not like I want as yet. Let me do some test first and I come back with an update.
XL

      From: "[hidden email]" <[hidden email]>
 To: [hidden email]
 Sent: Tuesday, September 6, 2016 7:40 AM
 Subject: Re: lasso 9.3.1.x > upload files > basic steps
   
2016-09-06 04:38 skrev XL Cordemans:

> Is there somewhere a guide for "dummies" for  uploading files ? 
> This is the set-up we have:- mac os X El Capitan (10.11.6)- lasso
> 9.3.1 (  )- Apache webserver- Mysql
> The questions:
> - folder permissions?- user settings?- path settings (I want it in the
> directory-folder manuals  */manuals/ )
> For testing I partially copied the code set by Jolle CarleStam in Jan
> this year and adapted it a bit. After  trying to upload the file
> test.txt this is what I get - BUT the file is nowhere to be seen ...
> !? 
> No error array (staticarray((contenttype = text/plain), (fieldname =
> upfile), (filename = test.txt), (tmpfilename =
> //tmp/lassomsbOyj71207157.uld), (filesize = 20291)))
>
> The Code is here below:
>
>     [File_CurrentError]    [local( upload = web_request ->
> fileuploads, file_subject = 'test' )]
>     <!DOCTYPE html>    <html lang="en">    <head>    <title>File
> upload test</title>    </head>    <body>    <form
> action="test_upload.lasso" method="post"
> enctype="multipart/form-data">    <input type="text" name="subject"
> value=""><br>    <input type=file name="upfile"><br>    <input
> type=submit value="submit">    </form>
> <hr>
>
> Thank you


Copy my code without using it? What's the point? :-)

Here's my suggested steps.

Grab the actual type from here:
https://gist.github.com/jolle-c/9957187

Make sure it's installed in a proper place.

Make sure Lasso can write to the directory you want your files in. Using
Terminal is the best place for this.

Navigate to the directory, you do this using su.

cd /path/to/site/manuals

Then set the permissions.

sudo chown -R _lasso:_lasso *
sudo chmod og+w

With this in place next step is to write your code. I don't agree on
your setup to have both code to handle the file upload and present the
upload html in the same place but that's not a showstopper.

Wherever you want to handle the upload. write this:

local(uploadfile = jc_fileuploads(1)) // the integer is optional and
will if provided restrict the method to the n:th count of uploaded files

#myfile -> save('/manuals/' + #myfile -> fieldname)

That should do it. NB I am on a trip and don't have access to my work
setup so the code is untested.

HDB
Jolle

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

   

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9.3.1.x > upload files > basic steps

Jolle Carlestam-2
I wrote my reply on a borrowed computer with a German keyboard.
Rereading what I wrote not all of it makes sense. But hopefully you get
the gist of it.

HDB
Jolle

2016-09-07 09:19 skrev XL Cordemans:

> Thank you Jolle for the explanation.
> Nice script.
> Getting something to work, not like I want as yet. Let me do some test
> first and I come back with an update.
> XL
>
>       From: "[hidden email]" <[hidden email]>
>  To: [hidden email]
>  Sent: Tuesday, September 6, 2016 7:40 AM
>  Subject: Re: lasso 9.3.1.x > upload files > basic steps
>
> 2016-09-06 04:38 skrev XL Cordemans:
>> Is there somewhere a guide for "dummies" for  uploading files ? 
>> This is the set-up we have:- mac os X El Capitan (10.11.6)- lasso
>> 9.3.1 (  )- Apache webserver- Mysql
>> The questions:
>> - folder permissions?- user settings?- path settings (I want it in the
>> directory-folder manuals  */manuals/ )
>> For testing I partially copied the code set by Jolle CarleStam in Jan
>> this year and adapted it a bit. After  trying to upload the file
>> test.txt this is what I get - BUT the file is nowhere to be seen ...
>> !? 
>> No error array (staticarray((contenttype = text/plain), (fieldname =
>> upfile), (filename = test.txt), (tmpfilename =
>> //tmp/lassomsbOyj71207157.uld), (filesize = 20291)))
>>
>> The Code is here below:
>>
>>     [File_CurrentError]    [local( upload = web_request ->
>> fileuploads, file_subject = 'test' )]
>>     <!DOCTYPE html>    <html lang="en">    <head>    <title>File
>> upload test</title>    </head>    <body>    <form
>> action="test_upload.lasso" method="post"
>> enctype="multipart/form-data">    <input type="text" name="subject"
>> value=""><br>    <input type=file name="upfile"><br>    <input
>> type=submit value="submit">    </form>
>> <hr>
>>
>> Thank you
>
>
> Copy my code without using it? What's the point? :-)
>
> Here's my suggested steps.
>
> Grab the actual type from here:
> https://gist.github.com/jolle-c/9957187
>
> Make sure it's installed in a proper place.
>
> Make sure Lasso can write to the directory you want your files in.
> Using
> Terminal is the best place for this.
>
> Navigate to the directory, you do this using su.
>
> cd /path/to/site/manuals
>
> Then set the permissions.
>
> sudo chown -R _lasso:_lasso *
> sudo chmod og+w
>
> With this in place next step is to write your code. I don't agree on
> your setup to have both code to handle the file upload and present the
> upload html in the same place but that's not a showstopper.
>
> Wherever you want to handle the upload. write this:
>
> local(uploadfile = jc_fileuploads(1)) // the integer is optional and
> will if provided restrict the method to the n:th count of uploaded
> files
>
> #myfile -> save('/manuals/' + #myfile -> fieldname)
>
> That should do it. NB I am on a trip and don't have access to my work
> setup so the code is untested.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: lasso 9.3.1.x > upload files > basic steps

XL Cordemans
Hi Jolle, 
all right, got it working all right now.
Thank you for the help.
My transition now from lasso 8.6 to 9.3.1.x is near completion. Worth the upgrade. 
Keep the score high,XL

      From: "[hidden email]" <[hidden email]>
 To: [hidden email]
 Sent: Wednesday, September 7, 2016 7:41 AM
 Subject: Re: lasso 9.3.1.x > upload files > basic steps
   
I wrote my reply on a borrowed computer with a German keyboard.
Rereading what I wrote not all of it makes sense. But hopefully you get
the gist of it.

HDB
Jolle

2016-09-07 09:19 skrev XL Cordemans:

> Thank you Jolle for the explanation.
> Nice script.
> Getting something to work, not like I want as yet. Let me do some test
> first and I come back with an update.
> XL
>
>      From: "[hidden email]" <[hidden email]>
>  To: [hidden email]
>  Sent: Tuesday, September 6, 2016 7:40 AM
>  Subject: Re: lasso 9.3.1.x > upload files > basic steps
>
> 2016-09-06 04:38 skrev XL Cordemans:
>> Is there somewhere a guide for "dummies" for  uploading files ? 
>> This is the set-up we have:- mac os X El Capitan (10.11.6)- lasso
>> 9.3.1 (  )- Apache webserver- Mysql
>> The questions:
>> - folder permissions?- user settings?- path settings (I want it in the
>> directory-folder manuals  */manuals/ )
>> For testing I partially copied the code set by Jolle CarleStam in Jan
>> this year and adapted it a bit. After  trying to upload the file
>> test.txt this is what I get - BUT the file is nowhere to be seen ...
>> !? 
>> No error array (staticarray((contenttype = text/plain), (fieldname =
>> upfile), (filename = test.txt), (tmpfilename =
>> //tmp/lassomsbOyj71207157.uld), (filesize = 20291)))
>>
>> The Code is here below:
>>
>>     [File_CurrentError]    [local( upload = web_request ->
>> fileuploads, file_subject = 'test' )]
>>     <!DOCTYPE html>    <html lang="en">    <head>    <title>File
>> upload test</title>    </head>    <body>    <form
>> action="test_upload.lasso" method="post"
>> enctype="multipart/form-data">    <input type="text" name="subject"
>> value=""><br>    <input type=file name="upfile"><br>    <input
>> type=submit value="submit">    </form>
>> <hr>
>>
>> Thank you
>
>
> Copy my code without using it? What's the point? :-)
>
> Here's my suggested steps.
>
> Grab the actual type from here:
> https://gist.github.com/jolle-c/9957187
>
> Make sure it's installed in a proper place.
>
> Make sure Lasso can write to the directory you want your files in.
> Using
> Terminal is the best place for this.
>
> Navigate to the directory, you do this using su.
>
> cd /path/to/site/manuals
>
> Then set the permissions.
>
> sudo chown -R _lasso:_lasso *
> sudo chmod og+w
>
> With this in place next step is to write your code. I don't agree on
> your setup to have both code to handle the file upload and present the
> upload html in the same place but that's not a showstopper.
>
> Wherever you want to handle the upload. write this:
>
> local(uploadfile = jc_fileuploads(1)) // the integer is optional and
> will if provided restrict the method to the n:th count of uploaded
> files
>
> #myfile -> save('/manuals/' + #myfile -> fieldname)
>
> That should do it. NB I am on a trip and don't have access to my work
> setup so the code is untested.
>
> HDB
> Jolle
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>   the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
>
> #############################################################
>
> This message is sent to you because you are subscribed to
>  the mailing list Lasso [hidden email]
> Official list archives available at http://www.lassotalk.com
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>

   

#############################################################

This message is sent to you because you are subscribed to
  the mailing list Lasso [hidden email]
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>