[SOLVED]Save files from LibreOffice/Firefox to network drive

[SOLVED]Save files from LibreOffice/Firefox to network drive

Postby maluethy » Jan 11th, '24, 16:41

I use Mageia 9 with Plasma Desktop and often work with a network drive (in the print screen "ESLA") to store and edit files. When using the network drive, I notice that the applications support this differently.
I can use the network drive directly with the Dolphin file explorer or the Spectacle print screen software.
NetworkDrive-Dolphin S02.jpg
Dolphin: Save file to network drive
NetworkDrive-Dolphin S02.jpg (38.58 KiB) Viewed 14238 times

With Firefox or LibreOffice Writer, however, files cannot be saved directly to the network drive or opened from the network drive. If I open a LibreOffice Writer document on the network drive and close it again, I cannot open it afterwards via the menu and the "Recent Documents" command of LibreOffice.
NetworkDrive-Firefox S02.jpg
Firefox: Save file to network drive
NetworkDrive-Firefox S02.jpg (58.58 KiB) Viewed 14238 times

NetworkDrive-LibreOffice-Writer S01.png
LibreOffice Writer: Save file to network drive
NetworkDrive-LibreOffice-Writer S01.png (62.67 KiB) Viewed 14238 times

Why is it that the network drive is supported so differently? Is there a way that Firefox and LibreOffice can also save files directly to the network drive and open them from there? Currently I save the files first in a local temporary folder and then move them to the network drive. I have set up the network drive in Dolphin and it works with Samba. I assume the situation would be the same with NFS?

Thanks in advance for the support.
Last edited by maluethy on Jan 16th, '24, 17:20, edited 1 time in total.
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 11th, '24, 21:29

maluethy wrote:I have set up the network drive in Dolphin and it works with Samba.

There is your explanation.
Firefox and LibreOffice are normally GTK application. They don't support the same filepicker as in Dolphin (even though someone added partial plasma filepicker support there).

You could just mount the network drive system-wide and it would be available equally for all application under a given mount point.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 11th, '24, 22:13

Thanks for the feedback.

How do I mount the network drive for a user system-wide? I don't really know how to implement this differently.

A while ago I made a forum request about this and from that I learnt that there is a problem with diskdrake. The suggestions for manual adjustments are not explained enough for me to be able to implement them. Is there a simpler solution in the meantime? Or where is a manual implementation described in more detail?
https://forums.mageia.org/en/viewtopic.php?f=25&t=14685
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 11th, '24, 22:47

You may want to reread what I wrote there:
doktor5000 wrote:Hi there, the issue with diskdrake is a longstanding bug. See e.g. https://bugs.mageia.org/show_bug.cgi?id=22011 or https://bugs.mageia.org/show_bug.cgi?id=25521
You can create the entry in /etc/fstab with diskdrake but you'd have to manually amend username, password and such (see the first bugreport for examples).


I mean it's a one-line entry in /etc/fstab that you can create with diskdrake. And you only have to amend your username and password there. Is that not enough explanation, what do you need explained in particular ?
Also see e.g. https://wiki.archlinux.org/title/samba#Manual_mounting

Alternatively you can also create a systemd mount unit: https://wiki.ubuntuusers.de/systemd/Mou ... -erstellen
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 12th, '24, 21:37

Thanks for the enquiry.

I don't know how to create the entry in /etc/fstab. - I tried to create an entry for the Samba network drive with diskdrake. I was able to specify the Samba user, but not the user password. Do I now write the password directly into the /etc/fstab file using an editor?
Where and how do I enter the options _netdev and nofail?

The line for the Samba network drive in /etc/fstab currently looks like this:
Code: Select all
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs username=xxxxx 0 0


Should it look like this with the password and the _netdev option?
Code: Select all
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs username=xxxxx,password=xxxxx,_netdev 0 0


The entire /etc/fstab currently looks like this:
Code: Select all
# Entry for /dev/nvme0n1p5 :
UUID=685a5905-a0b4-4fc5-8bef-7d8376d6c6be / ext4 relatime,acl 1 1
# Entry for /dev/nvme0n1p1 :
UUID=7F06-4E0D /boot/EFI vfat iocharset=utf8,umask=000 0 0
# Entry for /dev/nvme0n1p7 :
UUID=e225e0ac-6844-44c6-9d4c-75cfe64191bb /home ext4 relatime,acl 1 2
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs username= xxxxx 0 0
none /proc proc defaults 0 0
# Entry for /dev/nvme0n1p6 :
UUID=a176884a-4322-4e57-8f5a-bd79721a0fda swap swap defaults 0 0
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 13th, '24, 17:08

maluethy wrote:Should it look like this with the password and the _netdev option?
Code: Select all
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs username=xxxxx,password=xxxxx,_netdev 0 0

Exactly. Although out of habit I always put generic options like _netdev at the start of the options.
And you should should also pass nofail as option, otherwise if the share cannot be mounted it will block the boot process.

Code: Select all
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs _netdev,nofail,username=xxxxx,password=xxxxx 0 0


After putting that into the fstab, you should test if this can be mounted, as root via
Code: Select all
mount /mnt/ncp-esla
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 13th, '24, 20:49

Thanks for the feedback.

I was able to adjust the relevant line in fstab and the network drive appears with the name mnt/ncp-esla in Dolphin. Should a response appear when testing the entry as root? I have not received any. How do I know if the test was successful?

If I want to save a file to the network drive via Firefox, the message "The file could not be saved because you do not have the necessary authorisations." appears. I have checked the user and password again and they are correct.
Screenshot_20240113_183818.png
Firefox: Save file to network drive
Screenshot_20240113_183818.png (58.57 KiB) Viewed 14119 times


The network drive does not appear in LibreOffice Writer. The path is not accepted via the "Other locations" and "Connect to server" functions. I have tried smb://esla@192.168.178.10/ncp-esla/ and smb://192.168.178.10/ncp-esla/ and 192.168.178.10
Screenshot_20240113_191745.png
LibreOffice Writer: Save file to network drive
Screenshot_20240113_191745.png (81.61 KiB) Viewed 14119 times

I'm a bit confused about the result and don't know what to do next.
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 13th, '24, 21:18

maluethy wrote:Should a response appear when testing the entry as root? I have not received any. How do I know if the test was successful?

No. One of the older unix paradigms is basically: no message is good message. So if you don't get any error message, it was successful.
You can just list the contents with
Code: Select all
ls -al /mnt/ncp-esla


maluethy wrote:If I want to save a file to the network drive via Firefox, the message "The file could not be saved because you do not have the necessary authorisations." appears.

You need to make sure the mountpoint /mnt/ncp-esla is writable for your user. That need to be fixed once. As root
Code: Select all
chown maluethy:maluethy /mnt/ncp-esla

if your username is maluethy.

maluethy wrote:The network drive does not appear in LibreOffice Writer. The path is not accepted via the "Other locations" and "Connect to server" functions.

In your screenshot click on "Rechner" and navigate to /mnt/ncp-esla then add this as a bookmark.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 14th, '24, 09:24

Thanks for the explanations.

What kind of user do I specify in the command "chown maluethy:maluethy /mnt/ncp-esla"? - The user from the Mageia computer accessing the network drive? Or the user set up on the Samba network drive for the user of the Mageia computer? Or is it a combination of both? (The user name of the Mageia computer and the user name set up on the Samba network drive for the user of the Mageia computer are different in my case).

I have specified the user of the Mageia computer, but this has not solved the access restriction. Can I leave the effects of this command alone or should I correct or undo something?
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 14th, '24, 16:32

Yes the username of your local Mageia user. The user/password setup for the samba network drive only belong in /etc/fstab.
Please post the output of
Code: Select all
ls -al /mnt/ncp-esla
(you can omit folder names but please leave in at least one example to which you have no write permission).
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 14th, '24, 20:20

I probably don't have write permissions for any folder (I haven't tried them all). I certainly can't save any files in the main folder and in the subfolders "Bücher", "Einkauf", "Ferien" and "Test".

The console gives the following output:
Code: Select all
[shark22@localhost ~]$ ls -al /mnt/ncp-esla
insgesamt 40
drwxr-xr-x 2 root root     0 Jan 14  2024  ./
drwxr-xr-x 3 root root  4096 Jan 12 16:39  ../
drwxr-xr-x 2 root root     0 Nov  3 14:41  Bücher/
drwxr-xr-x 2 root root     0 Jan 14 15:08  Einkauf/
drwxr-xr-x 2 root root     0 Nov  3 14:41 '
drwxr-xr-x 2 root root     0 Jan 14 10:40  Ferien/
drwxr-xr-x 2 root root     0 Jan 11 09:27 'Finanzen Konto Bank'/
drwxr-xr-x 2 root root     0 Jan  7 15:28 'Finanzen Vorsorge'/
drwxr-xr-x 2 root root     0 Jan 13 11:11  Freizeit/
drwxr-xr-x 2 root root     0 Nov  3 14:42  Garten/
drwxr-xr-x 2 root root     0 Jan 14 10:18  Gesundheit/
drwxr-xr-x 2 root root     0 Jan  6 10:55  Haushalt/
drwxr-xr-x 2 root root     0 Jan 11 11:06  Haushaltsbuch/
drwxr-xr-x 2 root root     0 Jan  6 10:55  HG/
drwxr-xr-x 2 root root     0 Nov 11 11:46  Kiga/
drwxr-xr-x 2 root root     0 Nov  3 14:43 'Kontakt Privat'/
drwxr-xr-x 2 root root     0 Nov  3 14:43 'Korrespondenz Allg'/
drwxr-xr-x 2 root root     0 Nov 17 20:44  Krankenkasse/
drwxr-xr-x 2 root root     0 Nov  3 14:43  Küche/
drwxr-xr-x 2 root root     0 Nov  3 14:43  Mobilität/
drwxr-xr-x 2 root root     0 Nov 22 13:22  Post-Briefe-Pakete/
drwxr-xr-x 2 root root     0 Jan 14 14:50  
drwxr-xr-x 2 root root     0 Dez 27 07:35  Rechnungen/
drwxr-xr-x 2 root root     0 Nov  3 14:43  Seminare/
drwxr-xr-x 2 root root     0 Dez 31 19:39  Steuern/
drwxr-xr-x 2 root root     0 Jan  5 17:05  Technik/
drwxr-xr-x 2 root root     0 Jan 13 18:41  Test/
drwxr-xr-x 2 root root     0 Nov  3 14:43  Versicherung/
drwxr-xr-x 2 root root     0 Nov 26 12:01  Vorlagen/
-rwxr-xr-x 1 root root 34864 Nov 22 14:39 'Wohinversorgt V008.odt'*
drwxr-xr-x 2 root root     0 Nov  3 14:43  Wohnung/
drwxr-xr-x 2 root root     0 Nov 22 13:17 'x 0KB-Dateien'/
drwxr-xr-x 2 root root     0 Jan 14  2024 'x Archiv'/
drwxr-xr-x 2 root root     0 Nov  3 14:43 'x NcPi-Dateien'/
drwxr-xr-x 2 root root     0 Jan 14 19:03  Zukunft/
[shark22@localhost ~]$  
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 14th, '24, 23:15

You need to also provide the local user and group which should own the files/folders by default

//nextcloudpi/ncp-esla /mnt/ncp-esla cifs _netdev,nofail,username=xxxxx,password=xxxxx,uid=shark22,gid=shark22 0 0

In comparison you can also get the current options which were automatically determined with the output of
Code: Select all
mount | grep /mnt/ncp-esla
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Saving files from LibreOffice / Firefox to a network dri

Postby maluethy » Jan 16th, '24, 17:18

Thanks for adapting the code. I have updated the relevant line in /etc/fstab. Now it is possible to save files from LibreOffice, Firefox and Thunderbird to the Samba network drive, thanks for the support.

In LibreOffice I was able to create the bookmark for the Samba network drive. Thanks for the hint that this is possible.

To summarise, the following steps are necessary for a new installation so that the network drive can be accessed from LibreOffice, Firefox and Thunderbird (and other applications):
  • Create an entry for the Samba network drive with diskdrake.
  • Adapt the line created by diskdrake according to the pattern:
    //nextcloudpi/ncp-esla /mnt/ncp-esla cifs _netdev,nofail,username-smb=xxxxx,password-smb=xxxxx,uid=username-mga,gid=username-mga 0 0
  • As root, make the mountpoint /mnt/ncp-esla writable for the corresponding Mageia user:
    chown username-mga:username-mga /mnt/ncp-esla
As far as I understand, the network drive is mounted on the local computer. Is that correct?

I do not understand the meaning and effect of the code mount | grep /mnt/ncp-esla. Is the code necessary for using the network drive?
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: Saving files from LibreOffice / Firefox to a network dri

Postby doktor5000 » Jan 16th, '24, 18:58

For reference, this is not necessary. You can also mount it via Dolphin as you did before, find out the mountpoint for that and use that as a bookmark in LibreOffice, Firefox, Thunderbird or whatever GTK application.

maluethy wrote:As far as I understand, the network drive is mounted on the local computer. Is that correct?

Yes, same as with Dolphin. The only difference with doing it this way would be that the mountpoint is also at least visible to other users. For the Dolphin way it would basically be private to your current user.

maluethy wrote:I do not understand the meaning and effect of the code mount | grep /mnt/ncp-esla. Is the code necessary for using the network drive?

That is a command. It would show the currently used mount options for that network drive. It is not necessary.
You could also compare that way your fstab entry to the way Dolphin uses to mount this network share.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: [SOLVED]Save files from LibreOffice/Firefox to network d

Postby maluethy » Jan 17th, '24, 13:00

Many thanks for the further explanations.

In my last post, I forgot to ask the following question about the console solution: Does the summary of commands (the three points mentioned) include the necessary steps so that I can connect the computer to the Samba network drive during a new installation?
maluethy wrote: Create an entry for the Samba network drive with diskdrake.

Adapt the line created by diskdrake according to the pattern:
//nextcloudpi/ncp-esla /mnt/ncp-esla cifs _netdev,nofail,username-smb=xxxxx,password-smb=xxxxx,uid=username-mga,gid=username-mga 0 0

As root, make the mountpoint /mnt/ncp-esla writable for the corresponding Mageia user:
chown username-mga:username-mga /mnt/ncp-esla


If I mount the Samba network drive with Dolphin, I cannot save any files from LibreOffice Writer, Firefox or Thunderbird on the Samba network drive. I enter the mount point before the file name in the "Name" field. I use the address smb://192.168.178.10/ncp-esla/ or smb://username-smb@192.168.178.10/ncp-esla/ as the mount point. The message "The folder contents could not be displayed." appears and the Samba network drive is not selected. The address path is not changed from the internal hard drive (marked red) to the Samba network drive (marked green). What is the reason for this? - The Samba network drive can be accessed with Dolphin file explorer or Spectacle.
NetworkDrive-LibreOffice-Writer S02-2.png
LibreOffice Writer: Save file to network drive
NetworkDrive-LibreOffice-Writer S02-2.png (96.45 KiB) Viewed 13974 times

I have set up the Samba network drive in Dolphin via: External device > Add network folder ... Or do I have to do something else in the Plasma system settings (Network > Settings > Windows shares)?
maluethy
 
Posts: 83
Joined: Apr 17th, '20, 17:01

Re: [SOLVED]Save files from LibreOffice/Firefox to network d

Postby doktor5000 » Jan 17th, '24, 18:09

maluethy wrote:Does the summary of commands (the three points mentioned) include the necessary steps so that I can connect the computer to the Samba network drive during a new installation?

Yes. Apart from that you need to ensure that the hostname nextcloudpi resolves to the box hosting the network share.

maluethy wrote:If I mount the Samba network drive with Dolphin, I cannot save any files from LibreOffice Writer, Firefox or Thunderbird on the Samba network drive. I enter the mount point before the file name in the "Name" field. I use the address smb://192.168.178.10/ncp-esla/ or smb://username-smb@192.168.178.10/ncp-esla/ as the mount point. The message "The folder contents could not be displayed." appears and the Samba network drive is not selected. The address path is not changed from the internal hard drive (marked red) to the Samba network drive (marked green). What is the reason for this? - The Samba network drive can be accessed with Dolphin file explorer or Spectacle.

smb://192.168.178.10/ncp-esla/ or smb://username-smb@192.168.178.10/ncp-esla/ is an URI but seems libreoffice only accepts a filename, see the error message in the screenshot - it simply appends this to /home/shark22/Dokumente/... instead of using this as the full path
Although if KDE applications are accessing this they are using a so-called kio slave, which only works within KDE / plasma applications.

maluethy wrote:I have set up the Samba network drive in Dolphin via: External device > Add network folder ... Or do I have to do something else in the Plasma system settings (Network > Settings > Windows shares)?

No that only defines default credentials.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18067
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany


Return to Networking

Who is online

Users browsing this forum: No registered users and 1 guest

cron