How Do I Import Files Without Dropbox?

Post Reply
User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

How Do I Import Files Without Dropbox?

Post by rbytes » Sun May 12, 2019 5:27 am

;)
Attachments
997F2CDA-7840-4E61-81A0-E0340960020F.png
997F2CDA-7840-4E61-81A0-E0340960020F.png (3.05 MiB) Viewed 1397 times
Last edited by rbytes on Thu Jun 13, 2019 5:04 am, edited 8 times in total.
Zzzzz

Henko
Posts: 882
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: How Do I Import Files Without Dropbox?

Post by Henko » Sun May 12, 2019 12:06 pm

The videofile was downloaded, but only 1499 bytes size ??
It didn't play, just got a white screen with the quit button at the bottom.
But important fact is that a download from a website into the sB sandbox succeeded

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How Do I Import Files Without Dropbox?

Post by rbytes » Sun May 12, 2019 1:25 pm

Hmm. Maybe timed out partway through. Please try a few more times and let me know if you can ge the whole file. The size should be 2.05081E+07
Zzzzz

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How Do I Import Files Without Dropbox?

Post by rbytes » Sun May 12, 2019 5:52 pm

Oops. Found an error in my download code. I have reposted it. It should work for you now.

There is still an issue with testing for the correct file size, which is 2.05081E+07, just over 20 megabytes

What I thought would work was:

if sz=2.05081E+07 then ' test for equality
print "Successfully downloaded ";a2$
else
print "Download incomplete"
endif

But that always gives an incorrect answer!


So I changed it to:

if sz>2.05080E+07 then
print "Successfully downloaded ";a2$ 'test for greater than the next smaller size
else
print "Download incomplete"
endif

This change is not as accurate, but at least gives the correct response for a successful download.

Anyone know why this happens?
Zzzzz

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

A second file to download

Post by rbytes » Sun May 12, 2019 9:17 pm

;)
Last edited by rbytes on Wed Jun 26, 2019 12:04 am, edited 4 times in total.
Zzzzz

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

A third file to download

Post by rbytes » Tue May 14, 2019 11:01 pm

Continuing the demonstration of how you can import various types of files into Smart Basic without using its Dropbox connection ....

The third file I have available for you to download is an explosion sound effect. It is a .wav audio file - uncompressed.
Here is the download code:

;)
Last edited by rbytes on Wed Jun 26, 2019 12:04 am, edited 2 times in total.
Zzzzz

Henko
Posts: 882
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: A second file to download

Post by Henko » Wed May 15, 2019 10:57 am

rbytes wrote:
Sun May 12, 2019 9:17 pm

Code: Select all

N$="Alan Parsons.mid"
FILE N$ SETPOS 0
NOTES LOAD N$
NOTES PLAY
PAUSE NOTES_LENGTH (N$)
Hi, an error occurred: notes_length() must not have an argument.
Further, the test was succesfull

Henko
Posts: 882
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: A third file to download

Post by Henko » Wed May 15, 2019 11:03 am

rbytes wrote:
Tue May 14, 2019 11:01 pm
Continuing the demonstration of how you can import various types of files into Smart Basic without using its Dropbox connection ....

The third file I have available for you to download is an explosion sound effect. It is a .wav audio file - uncompressed.
Here is the download code:

Code: Select all

a2$="explosion.wav"
dn$="http://ricardobytes.com/ftp1/explosion.wav"
HTTP dn$ GETDIM m   'use the full url here.
FILE a2$ WRITEDIM m 'save just the filename.
sz=FILE_SIZE (a2$)
If sz>0 then
   Print "Connected to file..."
   print "Downloaded file size: ";sz;" bytes"
   if sz=37284 then
     print "Successfully downloaded ";a2$
   else
     print "Download incomplete"
   endif
else
   Print "file not found"
endif
end

To play the sound effect, run this code:

Code: Select all

M$="music"
F$="explosion.wav"
MUSIC M$ LOAD F$
MUSIC M$ PLAY
PAUSE MUSIC_LENGTH (M$)
end
I keep getting the message "download incomplete", with a "filesize" of 1699 bytes.

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How Do I Import Files Without Dropbox?

Post by rbytes » Wed May 15, 2019 1:21 pm

Yes, I see now that NOTES_LENGTH() does not take an argument, yet MUSIC_LENGTH() does. The code for file 2 is fixed now.

I keep getting the message "download incomplete", with a "filesize" of 1699 bytes.
I have also found and fixed the issue with file 3. I had copied all of the files to a folder called Test, but hadn't corrected the path for file 3. Sorry about that. Please use the new code.
Last edited by rbytes on Wed May 15, 2019 1:41 pm, edited 2 times in total.
Zzzzz

User avatar
rbytes
Posts: 1963
Joined: Sun May 31, 2015 12:11 am
My devices: iPhone X
iPad 4
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet
Location: Calgary, Canada
Flag: Canada
Contact:

Re: How Do I Import Files Without Dropbox?

Post by rbytes » Wed May 15, 2019 1:32 pm

Here is the 4th and last file to download. It is an mP3 sound effect of a fidget spinner. The download code:


;)
Zzzzz

Post Reply