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

[Feature request] Automatically import files from shared folder #344

Closed
jaapiyo opened this issue Oct 26, 2022 · 1 comment
Closed

[Feature request] Automatically import files from shared folder #344

jaapiyo opened this issue Oct 26, 2022 · 1 comment

Comments

@jaapiyo
Copy link

jaapiyo commented Oct 26, 2022

Awesome work on Picoshare!

It's currently running on my TrueNAS Scale server and I was wondering if it's possible to automatically import all files in a special directory? That way I don't have to upload them to my own server (were the files already are anyway). It also helps my workflow for releasing large files to my customers.

@mtlynch
Copy link
Owner

mtlynch commented Oct 27, 2022

Thanks for the kind words!

I'm not likely to support any kind of importing from the filesystem, as it's too far outside the scope of what I'd like PicoShare to be, but there are ways of auto-importing a directory that might work for you instead.

If you generate a guest link, you can upload from the command line, so you can do it like this:

  1. Generate a guest link in your PicoShare server
  2. Copy the ID portion of the guest link (the last part of the URL, after the /g/)
  3. Open a bash terminal session
  4. Navigate to the directory you want to upload
  5. Run the following snippet:
PICOSHARE_BASE_URL="http://127.0.0.1:4001" # Replace with your PicoShare server's address
GUEST_LINK_ID="gi7g6t9UcBCX6jv4"           # Replace with your guest link ID

for file in *; do
  curl -F "file=@${file}" "${PICOSHARE_BASE_URL}/api/guest/${GUEST_LINK_ID}"
done

That will iterate through your files and import them to PicoShare.

@mtlynch mtlynch closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants