Page 1 of 1
Publishing on website instructions?
Posted: Sun Dec 22, 2024 11:19 am
by Greippi
Hi,
Over the years, my internet development skills have deprecated almost entirely. I do remember HTML existed. Also, the internet files need to be available for the browser on a web server, which is a requirement. Oh yes, the main file is usually named "index.html". But what if I do a rather complex program on SpiderBasic and want to publish it on my website?
Is there a good and clear and simple instruction page for publishing a web app which has been made with Spider Basic?
I'd love to have more detailed information about "Creating an App" page.
For instance, where should the files go? And what should the permissions be to keep the site safe?
Back to school... I guess.
Any help would be awesome!
Cheers,
Greippi
Re: Publishing on website instructions?
Posted: Sun Dec 22, 2024 5:45 pm
by plouf
hi and welcome
1. when "create app" also check "copy spiderbasic libraries"
2. copy all files and folder inside "created app folder" anywhere to a webserver
3. (optionally) rename createdap.html to index.html
then open it in your browser
if you copy it with a ftp client for example at www/greipi.com/html/ xxxx (possible example of your server)
you open it via
www.greipi.com/ (index.html is omited)
this is the most generic and most probably enought, your hosting company may have have some diffirences but minor
Re: Publishing on website instructions?
Posted: Thu Mar 27, 2025 8:10 pm
by skywalk
I was hoping to show an QR code image on a web page and use Google Authenticator to read the image.
Google Authenticator will not scan the image if I load it into a simple html page and view in a chrome tab.
It only fires up with a web server page, so I thought to try it in SpiderBasic.
But now after a time away from Spiderbasic, I have errors getting example code to run from the IDE.
Do I have to Create web app for the example code to run?
I get loading error when running directly from the IDE with default compiler settings.
Code: Select all
Procedure Loaded(Type, Filename$, ObjectId)
; Display image in a new window
OpenWindow(#PB_Any, 10, 10, ImageWidth(ObjectId), ImageHeight(ObjectId), "Image")
ImageGadget(#PB_Any, 0, 0, ImageWidth(ObjectId), ImageHeight(ObjectId), ImageID(ObjectId))
EndProcedure
Procedure LoadingError(Type, Filename$, ObjectId)
Debug Filename$ + ": loading error"
EndProcedure
; Register the loading event before calling any resource load command
BindEvent(#PB_Event_Loading, @Loaded())
BindEvent(#PB_Event_LoadingError, @LoadingError())
;;OpenFileRequester("*.png",
LoadImage(0, "C:\ProgramData\SpiderBasic\Examples\Data\Spider.png");, #PB_LocalFile)
;LoadImage(0, "C:\dev-try\Authenticator\WIN_20250325_11_47_42_Pro.jpg", #PB_LocalFile)
Re: Publishing on website instructions?
Posted: Thu Mar 27, 2025 8:19 pm
by plouf
you cant direct access local drive files in a webbrowser (like a purebasic program can)
you can only use filerequest to let user to specifically use and open first ! (security shit)
Re: Publishing on website instructions?
Posted: Thu Mar 27, 2025 8:31 pm
by skywalk
Yeah, I get that, but I thought SpiderBasic would compile the image into the safe browser space?
Do I have to put the image in a DataSection and CatchImage?
Re: Publishing on website instructions?
Posted: Fri Mar 28, 2025 9:00 am
by Mindphazer
skywalk wrote: Thu Mar 27, 2025 8:31 pm
Yeah, I get that, but I thought SpiderBasic would compile the image into the safe browser space?
Do I have to put the image in a DataSection and CatchImage?
CatchImage doesn't exist in SB...
Re: Publishing on website instructions?
Posted: Fri Mar 28, 2025 1:16 pm
by skywalk
Ha! Didn't know that?
So, if I can store the bytes of an image in my DataSection, I forget how to retrieve that into an image.
Would that be blocked in browser?
Re: Publishing on website instructions?
Posted: Fri Mar 28, 2025 6:46 pm
by skywalk
I looked through some historical posts, and it is not clear how to store binary images for later use in SpiderBasic.
Is the DataSection the right place to store images?
Re: Publishing on website instructions?
Posted: Fri Mar 28, 2025 7:23 pm
by Paul
Is there a reason you can't load your images from a resource folder?
(See "Examples" folder "Waponez Web")