Comments (5)
I don't really understand this. You cannot save a file in the user's machine if they are using your app through a web browser. You can offer them a file to download, but you cannot specify where it is saved. But maybe I am misunderstanding something.
from rappdirs.
No. Exactly that. I thought it was possible. Thanks a lot. I'll look for an alternative
from rappdirs.
Now when we deploy the app to Posit Connect, rappdirs::user_data_dir() registers a dir on the posit connect server such that another user can load that saved input file.
Are you sure about this?
Aren't Connect deployments isolated from each other?
Also, what is that location? I think the Connect server runs on Linux, where the default data directory should be inside your home directory. E.g. for me:
> rappdirs::user_data_dir()
[1] "~/.local/share"
In any case, rappdirs follows the XDG spec (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), so you can set the XDG_DATA_HOME
env var to the desired location:
> Sys.setenv("XDG_DATA_HOME" = "/tmp/")
> rappdirs::user_data_dir()
[1] "/tmp/"
from rappdirs.
We are using the function to save an input file locally on people's machines, even though they are viewing a live deployed app. It's as though the file is being saved on the Connect server.
from rappdirs.
If you want to store some (small amount of) data on the user's machine, then you can use cookies:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
There is also an R package for that:
https://r4ds.github.io/cookies/
(I haven't tried it, so this is not an endorsement.)
from rappdirs.
Related Issues (20)
- Windows: appname double in user_config_dir HOT 1
- user_data_dir under Mac HOT 3
- CRAN complains about `user_cache_dir()` HOT 8
- Review windows C code HOT 4
- Release rappdirs 0.3.2 HOT 2
- rappdirs 0.3.2: 'version' argument is now vectorized, e.g. in user_cache_dir() HOT 1
- Fixing failing LTO check
- Option to change default path for `user_cache_dir`? HOT 3
- Release rappdirs 0.3.3
- HTTP status was '404 Not Found' HOT 1
- user_data_dir: Consistency of ~ vs expanded version HOT 2
- Path separator consistency on Windows HOT 1
- Move `master` branch to `main` HOT 1
- Using unallowed path? HOT 15
- Upkeep for rappdirs
- Upkeep for rappdirs (2023)
- Use cli errors or file an issue if you don't have time to do it now
- `usethis::use_standalone("r-lib/rlang", "types-check")` instead of home grown argument checkers;
- Add alt-text to pictures, plots, etc; see https://posit.co/blog/knitr-fig-alt/ for examples
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rappdirs.