Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added application/octet-stream section #205

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions sites/cheerpx/src/content/docs/11-guides/File-System-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,31 @@ Files in the WebDevice are accessed relative to the current page's URL. For exam
> [!note] Note
> It's important to note that this behavior depends on the current page's URL, as it uses a relative path. For more predictable results, it's recommended to use absolute paths when possible.

### Using `application/octet-stream` for WebDevice directories

To handle files from WebDevices properly, set default_type `application/octet-stream`. This ensures that files are treated as binary data. **Only apply this to WebDevice directories**, or it may cause issues like broken images or malfunctioning scripts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To handle files from WebDevices properly, set default_type `application/octet-stream`. This ensures that files are treated as binary data. **Only apply this to WebDevice directories**, or it may cause issues like broken images or malfunctioning scripts.
To handle files from WebDevices properly, set default_type `application/octet-stream`. This ensures that files are treated as binary data. **Only apply this to WebDevice directories**, or it may cause issues with image loading and JavaScript execution.


**Nginx configuration example**:

```nginx
http {
# Set default type to application/octet-stream for WebDevice directories
default_type application/octet-stream;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example should be structured differently. The file should be identical to the default configuration, and inside there must be a location section specific for the WebDevice that set the default mime type and remove all mime type definitions by using types { }

We should also add a example line that creates the WebDevice to show that the path is the same used in the location section


server {
listen 8080;
server_name localhost;

gzip on;
gzip_types application/javascript application/wasm text/plain application/octet-stream;

# Other configurations go here (see full basic server guide for details)
}
}
```

For a full server setup and additional details, check our [basic server guide](/docs/guides/nginx).

## IDBDevice

IDBDevice provides a persistent, read-write filesystem using the browser's IndexedDB. It's ideal for storing data that should persist between sessions.
Expand Down
Loading