Serving static content from Xojo Web

Now available on GitHub is open sourced code to help you serve static files from your Xojo Web application. This is especially useful if you are running standalone or load balanced apps and do not want to depend on another web server.

The code we are presenting on GitHub today allows you to easily map folders to the Xojo Web application to be served as static content. It is a drop in module that extends the ‘App’ object of your Xojo Web project making integrating it super simple.

The example project demonstrates two distinct static folders with a PDF, image, and text file. It demonstrates how to map the folders and the Xojo Web app presents links to test the functionality very quickly.

Blog Article: http://www.dev.1701software.com/blog/serving-static-content-from-xojo-web

GitHub: https://github.com/1701software/XojoWeb_StaticContent

Nice. Seems to work fine here. Thanks for posting it to the community.

Oooh! Very nice!

It would be nice if there were a way to send the file data in chunks so that it could handle large files better. AFAICT though, there is no way to get at the underlying socket to trigger the sending of the data and listen for the bytesLeft event to know when to feed more data.

This is true. We had to write our own web server to allow us to handle large file uploads/downloads. Accessory perks to this approach included being able to filter out obviously bad requests and better protect against DDoS attacks.

Yes, it seems writing a web server is a popular thing to do in Xojo given that it has a web option. I think I have 5 or 6 different web servers written in Xojo on my drive now. 2 or 3 I’ve picked up from the forums over time and I have 2 or 3 of my own in various projects.

New version updated on GitHub to fix issue with Firefox and some browsers.

Hello everyone.

I tried this code for Web App. I am using it to play local mp4 files in Web Movie Player. Playback works without problems, but I stuck when it comes to rewind. On every click it returns position to start. Files are properly encoded for HTML5 players, but still rewind is not possible. I need to implement frame accurate player, but didn’t find any which works when its using links from App. Last player I tried is JWplayer, but I have only playback. Same thing happens when I load files in any online test player using link from Web App.
Is it possible that something in creating file makes trouble?
All files I’m using are mp4 with bitrate ~650 Kbps.
Also, is there any other way to achieve playback of local files? I tried putting FolderItem in WebFile and it allows me to download file, which works perfectly, but trying to play in WEB Movie Player gives me just disabled player, it looks like it cannot load file.

Thank you

[quote=386870:@Aleksandar Spasojevi?]Hello everyone.

I tried this code for Web App. I am using it to play local mp4 files in Web Movie Player. Playback works without problems, but I stuck when it comes to rewind. On every click it returns position to start. Files are properly encoded for HTML5 players, but still rewind is not possible. I need to implement frame accurate player, but didn’t find any which works when its using links from App. Last player I tried is JWplayer, but I have only playback. Same thing happens when I load files in any online test player using link from Web App.
Is it possible that something in creating file makes trouble?
All files I’m using are mp4 with bitrate ~650 Kbps.
Also, is there any other way to achieve playback of local files? I tried putting FolderItem in WebFile and it allows me to download file, which works perfectly, but trying to play in WEB Movie Player gives me just disabled player, it looks like it cannot load file.

Thank you[/quote]
@aleksandar,
Please start a new thead/conversation.