Restrict file upload either by browser, or disable upload in browser but allow it in desktop/mobile app

Hi, I’ve got a nextcloud install working, but I have a bit of an odd usecase.

I need to disable file uploads from certain locations, but allow them from others.

Due to the situation, the location which should not be able to upload will be using a specific browser, and not have permissions to install the desktop app.

Thus, by either blacklisting uploads from the specific browser (Chrome), or blacklisting uploads from all browsers but allowing it from the desktop/mobile apps, I can accomplish what I need.

Is there any way to accomplish this?

---- EDIT ----
Didn’t want to zombie the thread, but figured I’d post the solution that I wound up on:

in the file ‘apps\files\templates\list.php’ in your root nextcloud folder, the lines 2-7:

		<div class="actions creatable hidden">
			<div id="uploadprogresswrapper">
			</div>
		</div>
		<div id="file_action_panel"></div>
		<div class="notCreatable notPublic hidden">

		<div id="file_action_panel"><?php echo ""; ?></div>
		<div>

will disable the upload button and cause the “You don’t have permission to upload or create files here” on line 9 to be displayed along with the alert icon.
Lines 75-77:

<div class="hiddenuploadfield">
	<input type="file" id="file_upload_start" class="hiddenuploadfield" name="files[]" />
</div>

→ delete
will disable drag-and-drop uploading.

You can, of course, add any logic you wish to check username, browser user agent, client IP, etc, to apply these changes (or not) in order to selectively disable file uploading. It most certainly is not foolproof, as it doesn’t remove the backend code, and thus the user could simply inspect → inject the changed/removed parts back in (or evade any user agent matching, use a VPN, etc). However, as a method to prevent naive users from uploading via the browser, it’s worked great for me for the past year.

I don’t know the reasons for your idea. But why don’t you send your management this link?

Security through obscurity – Wikipedia

Solution:
I think it is not really possible to use user agent of the browser to allow/disallow file upload to Nextcloud. But you can perhaps manipulate the source code. I believe the Nextcloud client uses a special user agent. Perhaps this can be extended or used in some way. But i think then you can not use the special browser anymore for Nextcloud.

I think it would be better to separate through networks and not through browsers. I think here, too, a distinction regarding upload is not possible.

You can probably recommend to the management to throw away their iPhones, where there is probably no limitation even with regard to the internet.