error trying to run in-browser from Dropbox

Here you can talk about anything related to BBC BASIC, not covered in another category
artfizz
Posts: 21
Joined: Wed 11 Dec 2024, 17:15

error trying to run in-browser from Dropbox

Post by artfizz »

Whilst I can successfully run programs from websites in-browser, when attempting to run my own program in-browser, I get an error.

When I specify a Dropbox link such as:
https://wasm.bbcbasic.co.uk/bbcsdl.htm ... -v112.bbb
(which has been generated using the Copy Dropbox Link option from the right-button context menu), I get the error:
[bgcolor=yellow]
unable to download ..dice-v112.bbb
[/bgcolor]
after about 20 seconds of attempted downloading.

Any suggestions (please!) as to what I am doing wrong?
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: error trying to run in-browser from Dropbox

Post by Richard Russell »

artfizz wrote: Sat 21 Dec 2024, 18:10 Any suggestions (please!) as to what I am doing wrong?
Not really. It's a long time since I've tried to use a Dropbox link for this purpose, and the URLs it now creates are very different from what they used to look like. I wouldn't be surprised if Dropbox has made a change, possibly in the interests of 'security', which stops this working. :(

If you do find a solution let me know.
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: error trying to run in-browser from Dropbox

Post by Richard Russell »

Richard Russell wrote: Sat 21 Dec 2024, 22:31 I wouldn't be surprised if Dropbox has made a change, possibly in the interests of 'security', which stops this working. :(
I think it's probably this: "Dropbox is moving to an updated shared link architecture where links are based on content rather than on users. This will affect how links are created and shared. The new links can be identified by the presence of an ‘rlkey’ parameter in the URL".

If I create a public shared link to a file in Dropbox it indeed does now contain a ?rlkey= parameter, and that confuses BBC BASIC because the URL no longer ends with '.bbb'. It will probably be necessary to parse the URL more carefully to identify the file's extension, even if followed by a parameter.

I will look into this, but my PHP coding skills are all but non-existent. :(
artfizz
Posts: 21
Joined: Wed 11 Dec 2024, 17:15

Re: error trying to run in-browser from Dropbox

Post by artfizz »

Richard Russell wrote:
If I create a public shared link to a file in Dropbox it indeed does now contain a ?rlkey= parameter, and that confuses BBC BASIC because the URL no longer ends with '.bbb'. It will probably be necessary to parse the URL more carefully to identify the file's extension, even if followed by a parameter.
Kudos for identifying the source of the problem!
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: error trying to run in-browser from Dropbox

Post by Richard Russell »

Richard Russell wrote: Sun 22 Dec 2024, 11:33 I will look into this, but my PHP coding skills are all but non-existent. :(
I can confirm that it's definitely the ?rlkey parameter, which is now required for a shared public Dropbox link to work, but which BBC BASIC doesn't accept because it is expecting the last four characters of the URL to be .bbb.

However the necessary modifications to make it work would be non-trivial and I don't feel confident to attempt them without introducing a bug (they would involve changes to both BBC BASIC code and PHP code). Therefore my recommendation is to find somewhere else to upload your file, sorry.
artfizz
Posts: 21
Joined: Wed 11 Dec 2024, 17:15

Re: error trying to run in-browser from Dropbox

Post by artfizz »

Richard Russell wrote:
Therefore my recommendation is to find somewhere else to upload your file, sorry.
That's perfectly reasonable advice.

Microsoft OneDrive links are even worse: they don't even include a filetype.
That leaves plenty more cloud-storage facilities for me to investigate.
Richard Russell
Posts: 272
Joined: Tue 18 Jun 2024, 09:32

Re: error trying to run in-browser from Dropbox

Post by Richard Russell »

Richard Russell wrote: Sun 22 Dec 2024, 12:41 However the necessary modifications to make it work would be non-trivial and I don't feel confident to attempt them without introducing a bug...
There is, however, a slightly evil workaround which seems to work here: :evil:
  1. Change ?rlkey to +rlkey
  2. Add .bbb to the end of the URL!
The change from ? to + makes the URL syntax valid, and adding .bbb keeps BBC BASIC happy. :)

So for example if the shared public URL generated by Dropbox is:

Code: Select all

https://www.dropbox.com/scl/fi/abcdefghijlklmnopqrstuvwxy/myapp.bbb?rlkey=yxwvutsrqponmlkjihgfedcba
Change it to:

Code: Select all

https://www.dropbox.com/scl/fi/abcdefghijlklmnopqrstuvwxy/myapp.bbb+rlkey=yxwvutsrqponmlkjihgfedcba.bbb
Note that you must not add either ?dl=0 or ?dl=1 to the URL.
artfizz
Posts: 21
Joined: Wed 11 Dec 2024, 17:15

Re: error trying to run in-browser from Dropbox

Post by artfizz »

Richard Russell wrote:
There is, however, a slightly evil workaround which seems to work here: :evil:
Change ?rlkey to +rlkey
Add .bbb to the end of the URL!
A no-code solution .. sheer sourcery!
Many thanks... and a Happy Christmas!