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

internal link should open file not directory #22541

Closed
ferdiga opened this issue Sep 1, 2020 · 27 comments
Closed

internal link should open file not directory #22541

ferdiga opened this issue Sep 1, 2020 · 27 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap enhancement needs info

Comments

@ferdiga
Copy link

ferdiga commented Sep 1, 2020

Steps to reproduce

  1. click share
  2. select/copy internal link
  3. past this link into browser

Expected behaviour

should open the shared file

Actual behaviour

opens the directory with the file - confusing as the users with the link does not know the file name
BTW it should work like "external link" which opens the file.

Server configuration detail

Operating system: Linux 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u2 (2019-11-11) x86_64

Webserver: Apache/2.4.25 (Debian) (apache2handler)

Database: mysql 10.4.8

PHP version:

7.3.21-1+020200807.66+debian91.gbp18a1c2
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, apache2handler, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, intl, json, ldap, exif, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, apc, posix, readline, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Phar, libsmbclient, Zend OPcache

Nextcloud version: 19.0.1 - 19.0.1.1

Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from: unknown

Signing status

Array
(
)

List of activated apps
Enabled:
 - accessibility: 1.5.0
 - activity: 2.12.0
 - admin_audit: 1.9.0
 - analytics: 2.4.1
 - announcementcenter: 3.8.1
 - apporder: 0.10.0
 - audioplayer: 2.11.2
 - bruteforcesettings: 2.0.1
 - calendar: 2.0.4
 - carnet: 0.22.2
 - circles: 0.19.5
 - cloud_federation_api: 1.2.0
 - comments: 1.9.0
 - contacts: 3.3.0
 - contactsinteraction: 1.0.0
 - dashboard: 6.0.0
 - dav: 1.15.0
 - deck: 1.0.5
 - documentserver_community: 0.1.7
 - drawio: 0.9.7
 - emlviewer: 0.0.17
 - external: 3.6.0
 - federatedfilesharing: 1.9.0
 - files: 1.14.0
 - files_accesscontrol: 1.9.0
 - files_automatedtagging: 1.9.0
 - files_downloadactivity: 1.8.0
 - files_external: 1.10.0
 - files_fulltextsearch: 1.4.3
 - files_fulltextsearch_tesseract: 1.4.2
 - files_pdfviewer: 1.8.0
 - files_photospheres: 1.19.1
 - files_rightclick: 0.16.0
 - files_sharing: 1.11.0
 - files_trashbin: 1.9.0
 - files_versions: 1.12.0
 - files_videoplayer: 1.8.0
 - fulltextsearch: 1.4.2
 - fulltextsearch_elasticsearch: 1.5.2
 - groupfolders: 7.0.0
 - issuetemplate: 0.6.0
 - logreader: 2.4.0
 - lookup_server_connector: 1.7.0
 - mail: 1.4.1
 - metadata: 0.12.0
 - nextcloud_announcements: 1.8.0
 - notes: 3.6.4
 - notifications: 2.7.0
 - oauth2: 1.7.0
 - ocr: 6.0.55
 - ocsms: 2.1.8
 - onlyoffice: 4.3.0
 - password_policy: 1.9.1
 - phonetrack: 0.6.4
 - photos: 1.1.0
 - previewgenerator: 2.3.0
 - privacy: 1.3.0
 - provisioning_api: 1.9.0
 - quickaccesssorting: 1.0.3
 - quicknotes: 0.6.0
 - quota_warning: 1.8.0
 - rainloop: 7.0.2
 - recommendations: 0.7.0
 - serverinfo: 1.9.0
 - settings: 1.1.0
 - sharebymail: 1.9.0
 - socialsharing_email: 2.1.0
 - spreed: 9.0.3
 - support: 1.2.1
 - survey_client: 1.7.0
 - suspicious_login: 3.2.0
 - systemtags: 1.9.0
 - tasks: 0.13.3
 - text: 3.0.1
 - theming: 1.10.0
 - twofactor_backupcodes: 1.8.0
 - updatenotification: 1.9.0
 - user_usage_report: 1.3.3
 - viewer: 1.3.0
 - workflow_pdf_converter: 1.4.0
 - workflow_script: 1.4.0
 - workflowengine: 2.1.0
Disabled:
 - cms_pico
 - dashboardcharts
 - encryption
 - federation
 - files_retention
 - firstrunwizard
 - ojsxc
 - printer
 - registration
 - user_ldap
 - wopi

Configuration (config/config.php)
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "19.0.1.1",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "enable_previews": true,
    "forcessl": true,
    "theme": "",
    "maintenance": false,
    "mail_smtpmode": "smtp",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtptimeout": 10,
    "loglevel": 0,
    "share_folder": "\/Shared",
    "trusted_domains": [
        "service.chricar.at"
    ],
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "singleuser": false,
    "forceSSLforSubdomains": true,
    "trashbin_retention_obligation": "auto",
    "filelocking.enabled": "true",
    "filesystem_check_changes": 1,
    "mail_smtpauthtype": "PLAIN",
    "mail_smtpsecure": "tls",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "auth.bruteforce.protection.enabled": true,
    "overwriteprotocol": "https",
    "overwrite.cli.url": "https:\/\/service.chricar.at\/owncloud",
    "updater.release.channel": "stable",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379,
        "password": "***REMOVED SENSITIVE VALUE***",
        "timeout": 1.5
    },
    "preview_max_x": 512,
    "preview_max_y": 512,
    "preview_max_scale_factor": 1,
    "preview_libreoffice_path": "\/usr\/bin\/libreoffice",
    "enabledPreviewProviders": [
        "OC\\Preview\\Image",
        "OC\\Preview\\MP3",
        "OC\\Preview\\TXT",
        "OC\\Preview\\PDF",
        "OC\\Preview\\Movie",
        "OC\\Preview\\Photoshop",
        "OC\\Preview\\TIFF",
        "OC\\Preview\\SVG",
        "OC\\Preview\\OpenDocument"
    ],
    "has_rebuilt_cache": true,
    "mysql.utf8mb4": true,
    "app_install_overwrite": [
        "files_clipboard",
        "files_accesscontrol",
        "issuetemplate",
        "dashboard",
        "files_external_gdrive",
        "ojsxc",
        "quickaccesssorting",
        "ocr"
    ],
    "updater.secret": "***REMOVED SENSITIVE VALUE***"
}

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption:

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36

Operating system: ubuntu 20.04

Logs

Web server error log
Insert your web server log here 
Nextcloud log
Insert your Nextcloud log here
Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@ferdiga ferdiga added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 1, 2020
@jospoortvliet
Copy link
Member

The browser scrolls to the file and highlights it, though in my experience this isn't always very reliable.

Thing is - one can't 'open the file' as many file types are simply not supported with an online viewer. I agree with you that it would be nice, though. Perhaps we could at least do that on files that ARE supported in a viewer...

@ferdiga
Copy link
Author

ferdiga commented Sep 14, 2020

Thanks for looking into this
Probably a only office style menu would be helpful to allow quick selection of the desired action (open, download,....)

@q-wertz
Copy link

q-wertz commented Oct 1, 2020

Or the standard Download Menu from the Browser

@Perino01
Copy link

Perino01 commented Dec 9, 2020

If I share a document with 'Share link', than the link leads direct to the document. So when I copy the link to a browser or click the link from an excel cell, the link opens the document!

If I share the same document with 'Internal Link', which I would prefer, then the link leads only to the directory of the file. It is not possible, to open the docment, by clicking the link!

Why it is possible, in the first case, but not realizable in the second case (which is much more secure)?

@alexanderdd
Copy link
Contributor

IMO this is a duplicate of #12470

@ferdiga
Copy link
Author

ferdiga commented Feb 5, 2021

If I share a document with 'Share link', than the link leads direct to the document. So when I copy the link to a browser or click the link from an excel cell, the link opens the document!

If I share the same document with 'Internal Link', which I would prefer, then the link leads only to the directory of the file. It is not possible, to open the docment, by clicking the link!

Why it is possible, in the first case, but not realizable in the second case (which is much more secure)?

I agree, this is a very strange behavior - nevertheless understandable and good, external users must not see the files in the directory.

@Perino01
Copy link

Perino01 commented Feb 6, 2021

This is not a question of authorization, of course only authorized users are allowed to view the files. It is very inconvenient if you click on a link where you expect a file and only a directory is opened. If you use this link as a reference (for example in a mail or in a document), you don't know which of the many files in this folder is meant.

@alexanderdd
Copy link
Contributor

Does anybody know which users can do triage? I.e. remove "needs triage" and add "to develop"

@juliushaertl
Copy link
Member

#12470 is not really about the internal link but the one that is presented to the user in the browsers url bar, so I'd keep those separate.

I think it is kind of debatable which behavior would be expected here, though for files it probably makes more sense to open them right away instead of just scrolling to them in the file list. What do you think @nextcloud/designers ?

@alexanderdd
Copy link
Contributor

#12470 is not really about the internal link but the one that is presented to the user in the browsers url bar, so I'd keep those separate.

@juliushaertl can you rename that issue #12470 so the difference to this one here is clear?

@dartcafe
Copy link
Contributor

The current behavior should be kept, it heavily supports efficency in our company. We often use internal links to files and it is usual, that not only the linked file is of interest but also other files which are kept in the same (project) directory. As long as the linked file is highlighted, there is enough context IMHO.

@szaimen
Copy link
Contributor

szaimen commented Apr 11, 2021

Maybe it could do both? So open the directory in the files app and also open the file directly itself?

@dartcafe
Copy link
Contributor

Another possible solution could be, that the internal link leads to a selection, where you can decide, if you want to

  • download and open the file,
  • open the file in the browser (if there is an app installed for the file) or
  • just open in the directory and highlight the linked file.

One of my secret wishes: Open file locally (from my local synced folder).

@Perino01
Copy link

If you send an link, refering to a document to person, and only a directory opens and not the document itself, then the user gets confused! Especially in case of a directory with lots of files.

Furthermore, if you have a document eg. Excel Calculation, with links to documents like offers or bills, then it is useless to click on one of the links and only a directory with dozens of files gets opened.

@Perino01
Copy link

Another possible solution could be, that the internal link leads to a selection, where you can decide, if you want to

* download and open the file,

* open the file in the browser (if there is an app installed for the file) or

* just open in the directory and highlight the linked file.

One of my secret wishes: Open file locally (from my local synced folder).

Nice approach!

@szaimen
Copy link
Contributor

szaimen commented Jul 2, 2021

cc @nextcloud/designers

@sebastienaubry
Copy link

Same problem here: I created a simple notepad for my holidays and just want to quickly open it in edition mode. Currently, I only manage to do that by sharing it (which I don't want): if it is not shared, the "openfile" URL gives me a "download.zip" file.

Given the comments, I suggest that we keep the current behaviour for the current internal files links, but add a link attribute (e.g. &edit=true) to open the file in edition mode in order to allow rich text "Notes" use case: sometimes you just want to open a list and edit it, and it should be possible to create a shortcut to the edition mode. Currently it seems that only the shared files can be directly opened in edition mode.

@alexanderdd
Copy link
Contributor

@szaimen you added "needs info" label -- which information do you need?

@bitdivine
Copy link

bitdivine commented Aug 10, 2021

@sebastienaubry I agree, albeit with a minor tweak. edit=true has limited use, it can be only edit=true or edit=false and the false version might as well be omitted. Instead one might have e.g. view=edit or view=readonly or view=directory (the current default) etc.

Regarding how to handle files that don't have a viewer, in asimilar situation Google Drive asks the viewer what they would like to do, with options typically including download and letting the user choose an app that can handle the file type.

@szaimen
Copy link
Contributor

szaimen commented Aug 10, 2021

@artonge didn't you recently implemented something like the discussed feature here?

@skjnldsv
Copy link
Member

#28174

@skjnldsv
Copy link
Member

backported to 22 (not 20 nor 21 and it won't be)

@stefankrischer
Copy link

Do I understand the last comments here right, that this was successfully implemented? Do i have to activate it somewhere? Because on Nextcloud Hub II (23.0.3) we still experience the initial behavior of opening the folder instead of the file and i don't find the right settings to change that.

@az-bp
Copy link

az-bp commented Jun 8, 2022

backported to 22 (not 20 nor 21 and it won't be)

I also encountered the same problem.
I have recently integrated Nextcloud and ONLYOFFICE.
When you open internal link, it opens file location instead of that file itself.
Opening external link actually opens a file.
I upgraded Nextcloud from version 21 to 22 and now to 23.0.5.
That did not solve the issue.

@alexanderdd
Copy link
Contributor

alexanderdd commented Jun 10, 2022

Works as expected for me in Nextcloud 23.0.5 with Collabora CODE

@errotu
Copy link

errotu commented Sep 20, 2023

I can confirm the behavior @az-bp describes, currently it's not working with OnlyOffice (NC 26.0.1). Is there any workaround/solution for that?

@pikachurus
Copy link

pikachurus commented Aug 1, 2024

backported to 22 (not 20 nor 21 and it won't be)

I also encountered the same problem. I have recently integrated Nextcloud and ONLYOFFICE. When you open internal link, it opens file location instead of that file itself. Opening external link actually opens a file. I upgraded Nextcloud from version 21 to 22 and now to 23.0.5. That did not solve the issue.

same problem here.

nextcloud 28.0.8
onlyoffice 8.1.1.26

internal link https://xxx.xxx/index.php/f/60449 opens https://xxx.xxx/index.php/apps/files/files/60449?dir=/ with focus on 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 needs info
Projects
None yet
Development

No branches or pull requests