Hi Alex,
I think this should really be the last question in the application
development question series.

The eventual goal of my app is to translate a music midi file to Sonic Pi
<https://sonic-pi.net/> :). I am having some trouble getting the file
upload to work. The app should really just have upload button on the page
and when a midi file is uploaded, I do my thing and write out the SonicPi
code.


(app)


(action

   (html 0 "Case Conversion" "@lib.css" NIL

      (form NIL

         (<grid> 2

            "File"

            (gui '(+Able +UpField) '(not (: home obj jpg)) 30)

            (gui '(+Drop +Button) '(field -1)

               '(if (: home obj jpg) ,"Uninstall" ,"Install")

                  '(cond

                     ((: home obj jpg)

                        (ask ,"Uninstall Picture?"

                           (put!> (: home top 1 obj) 'jpg NIL) ) )

                     ((: drop) (blob! (: home obj) 'jpg @)) ) ) <-- I
presume the file processing logic would go in here.

         ) ) ) )


The above code (from documentation of +Drop) gives me a put!> -- bad message


I'd appreciate a sample where the app shows a file picker and then when we
submit the file, it prints out the length of the file. I can take it from
there :)


Regards,

Kashyap

Reply via email to