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

Embed public files on a Website #1472

Closed
skerbis opened this issue Sep 20, 2016 · 20 comments
Closed

Embed public files on a Website #1472

skerbis opened this issue Sep 20, 2016 · 20 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: files feature: sharing help wanted

Comments

@skerbis
Copy link

skerbis commented Sep 20, 2016

Is there a way to embed a public folder by iframe or php into a Website,
so that a user can browse a folder and download the files he or she needs.
Or do you know a nice Webdav browsing class for PHP?
We want to share some public data which will be perhaps managed in a nextcloud.

@eppfel eppfel added help wanted needs info feature: sharing 0. Needs triage Pending check for reproducibility or if it fits our roadmap feature: files labels Sep 20, 2016
@eppfel
Copy link
Member

eppfel commented Sep 20, 2016

Is there a way to embed a public folder by iframe or php into a Website

This imposes a security risk, if not from same origin and is not advised. 😁
@nextcloud/security Right? Do you know something? -->

Or do you know a nice Webdav browsing class for PHP?

@eppfel eppfel changed the title Embed public files on a Webite Embed public files on a Website Sep 20, 2016
@jospoortvliet
Copy link
Member

There's more than iframing this.

What about embedding an image on a public website, in a forum somewhere?

Say you're on a forum like here:
https://forum.kde.org/viewtopic.php?f=221&t=137440&p=367768#p367768
and you want to embed an image from a Nextcloud instance, you get a URL like:
https://share.kde.org/index.php/apps/files_sharing/ajax/publicpreview.php?x=600&y=558&a=true&file=sharing.png&t=tH1ZvenNd3JPFM8&scalingup=0

A few more points:

@nextcloud/designers do you think it would make sense to try and simplify these links and make it easier to embed images from a Nextcloud instance in other places? I'd actually love to put a screenshot on my NC and directly paste the image here...

@eppfel
Copy link
Member

eppfel commented Dec 6, 2016

@jospoortvliet I opened a dedicated issue, because the use case @skerbis mentioned, is a little bit different and I like your idea!

@skerbis Why does your "folder" have to be embedded into another site? Would theming and a direct link not be enough?

@MorrisJobke
Copy link
Member

See also #2523 (comment) for the security aspects ;)

@skerbis
Copy link
Author

skerbis commented Dec 6, 2016

@eppfel the best thing would be a PHP-Class which allwos me to show the Folders, Files and Subfolders inside the Website. The Folder is managed inside nextcloud but should be shown on the Website. Perhaps does anyone know a PHP-Script for integrating a webdav-browser?

@skerbis
Copy link
Author

skerbis commented Sep 23, 2017

or short is there a api for that?

@jospoortvliet
Copy link
Member

Well there's webDAV & the OCS API, but you'd have to write your own view. Perhaps CMS Pico can help?

https://github.com/nextcloud/cms_pico

@Xemanth
Copy link

Xemanth commented Feb 5, 2018

Any progress on this matter? It would be excellent feature to view Nextcloud public link "folder" straight from Wordpress.

@skerbis
Copy link
Author

skerbis commented Feb 5, 2018

@Xemanth or any other "real" CMS ;-)

@mveplus
Copy link

mveplus commented Mar 7, 2018

Thanks, NC team & fans! Direct share link for an Image works great in v13!
It would be great if this can grow up to be done for a folder or a video for purpose of HTML image/video storage backend.
I'm running NC on VPS and I host a static HTML page on the same VPS behind Nginx on the same domain/cloud is NC served by Nginx.
I was looking into OCS APIs and user created just for accessing shared folders for accessing user shares and serving folder-images for this static HTML page or thinking of using just bare share URL generated from NC, but still can't figure it out what would be the best way to accomplish this if possible without adding any security flaws.
I don't want to go iframe so is there a way to use raw shared folder content?
Is there a way to access/list public shared folder using OCS API without user authentication?

Kind Regards,

@jospoortvliet
Copy link
Member

@mveplus it must be possible, though I don't know how... As I said, you can use cms_pico for some things, at least - https://nextcloud.com/blog/nextcloud-introduces-easy-website-builder-for-education-edition-with-picocms/

@SlavikCA
Copy link

SlavikCA commented Mar 7, 2018

@mveplus
There are few ways to do it. Here is how I do it:

@mveplus
Copy link

mveplus commented Mar 7, 2018

Thanks, @jospoortvliet and @SlavikCA I have now a few more thoughts to chew up and tinker.
I've looked at picocms it looks interesting, for time being I think vhost option would serve me better, I'm going to try it ;)

Thanks for taking the time to replay! I'm sure if there is enough interest NC team will come up with a solution.
Cheers

@doogalbear
Copy link

@SlavikCA
I like your approach. I'm fairly new to vhost setups. Can you share an example of how this is setup. I am wanting to do this with Ghost and Nextcloud.

@skerbis
Copy link
Author

skerbis commented Mar 23, 2018

@skerbis skerbis closed this as completed Mar 23, 2018
@srednax
Copy link

srednax commented Nov 13, 2019

Works for me:
https://www.ortlepp.eu/blog/2016/access_nextcloud_with_php_and_curl.html

The link is not working. It would be nice with a description on how to do this :)

@skerbis
Copy link
Author

skerbis commented Nov 13, 2019

@kesselb
Copy link
Contributor

kesselb commented Nov 13, 2019

https://docs.nextcloud.com/server/latest/user_manual/files/access_webdav.html#accessing-files-using-curl

(above link will always point to the latest documentation)

@skerbis
Copy link
Author

skerbis commented Nov 13, 2019

Here's a PHP-Solution: https://github.com/fercavi/webdav

@srednax
Copy link

srednax commented Nov 13, 2019

I installed an app that provides a link, called shared path. It is immature, but it does provide a functional URL if you share a link to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement feature: files feature: sharing help wanted
Projects
None yet
Development

No branches or pull requests

10 participants