• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
sharadchhetri

sharadchhetri

Tutorials On Linux, Unix & Open Source

  • Home
  • Linux Commands
  • Resources
    • Learn Linux
  • My WordPress plugins

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

March 29, 2013 by Sharad Chhetri 2 Comments

The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form

After installing the owncloud in Ubuntu Server I faced the problem, I was not able to upload the file. I was getting this error “The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form”

owncloud4

How I solved the issue,Below are the steps

Step 1: Edit the php.ini file and increase the value of parameter upload_max_filesize

vi /etc/php5/apache2/php.ini

upload_max_filesize = 10G

Restart the apache after saving the php.ini file

/etc/init.d/apache2 restart

Step 2: The main problem I found in .htaccess file. .htaccess has symlink in /usr/share/owncloud . The original path of htaccess file is at /etc/owncloud/htaccess.
You can choose any path to edit this file

change the value of these two parameters.

php_value upload_max_filesize
php_value post_max_size

sharad@ubuntu-pc:~$ sudo su –
Give the password of user

root@ubuntu-pc:/# cd /usr/share/owncloud
root@ubuntu-pc:/usr/share/owncloud# vi .htaccess
ErrorDocument 403 /owncloud/core/templates/403.php
ErrorDocument 404 /owncloud/core/templates/404.php

php_value upload_max_filesize 2000M
php_value post_max_size 2000M
php_value memory_limit 512M

SetEnv htaccessWorking true

RewriteEngine on
RewriteRule .* – [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^.well-known/carddav /remote.php/carddav/ [R]
RewriteRule ^.well-known/caldav /remote.php/caldav/ [R]
RewriteRule ^apps/([^/]*)/(.*.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]

Options -Indexes

Save and exit by pressing the key “esc :wq”
root@ubuntu-pc:/usr/share/owncloud#

Step 3: Restart the apache2

root@ubuntu-pc:/usr/share/owncloud#/etc/init.d/apache2 restart

Now try again. It should be solved now.

Share this:

  • Twitter
  • Facebook
  • More
  • Print
  • Email
  • LinkedIn
  • Reddit
  • Tumblr
  • Pinterest
  • Pocket
  • Telegram
  • WhatsApp
  • Mastodon

Related posts:

  1. remove html tags by using sed command
  2. Hide and disable URL field in comment form in WordPress [ Plugin ]
  3. NOTICE: nagios.cmd file not found. Please specify the location of this file in your /etc/vshell.conf file
  4. How to convert rpm file into deb file
  5. Convert video file into gif file through command line in linux
  6. How to create iso file from CD/DVD and how to mount .iso file in folder
  7. Your data directory and files are probably accessible from the internet because the .htaccess file does not work owncloud
  8. Give permission reference to file/dir from other file/dir in linux
  9. group ownership reference to file/dir from other file/dir in linux
  10. shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

Filed Under: Linux, owncloud, Tips And Tricks Tagged With: owncloud

Reader Interactions

Comments

  1. Chris says

    June 10, 2013 at 9:38 am

    First of all, thank you for your HowTo.

    If you use an embedded device which stores its /tmp folder in a ramdisk the maximum uploadsize for one file is the size of the ramdisk. If you want larger file you have to enable “upload_tmp_dir” in the php.ini and provide it with a path to a folder on a larger disk. This will php force to store all http uploads on the given location.
    To avoid problems I set the path to the same disk where my owncloud data folder is located.

    Chris

    Reply
    • admin says

      June 10, 2013 at 9:55 am

      thanks chris

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Our Social Media Presence

  • Facebook
  • GitHub
  • Twitter

Linux Command

What is Linux Internal And External Command

Linux Basic Commands With Examples For Every Beginner

tr command to convert lines to space , tab and vertical tab

smbpasswd command not found on CentOS 7 and RHEL 7

Solution : semanage command not found

Unix / Linux : How to print duplicate lines from file

More Posts from this Category

You Might Like These Articles!

simplecodesyntax wordpress plugin

SimpleCodeSyntax : My Another WordPress Plugin

Install Nginx

How To Install Nginx On Ubuntu 22.04 LTS

Install Latest Git package in Ubuntu Operating System

How To Always Install Latest Git Package In Ubuntu Operating System

Bash script for installing VirtualBox on Ubuntu 22.04 LTS Desktop

Install VirtualBox On Ubuntu 22.04 LTS Desktop (Bash Script)

libfuse

dlopen(): error loading libfuse.so.2 – Got Error On Ubuntu

Failed to open/create the internal network

VirtualBox Error: Failed to open/create the internal network

Always Useful Tips And Tricks

New XAMPP security concept

How to reset forgot root password in CentOS 6.x and Redhat 6.x

How to configure ethernet in CentOS 6 after installing in Virtual Box

How to create a file with cat command

Recover Linux Grub Password in linux rescue mode CentOS/Red Hat

How to zip the directory in linux with command line

30 useful Linux terminal keyboard shortcuts

Explore 90+ Article On "Linux Tips And Tricks"

Copyright © 2023 ยท
The material in this site cannot be republished either online or offline, without our permission.
Proudly Blogging From Bharat.

  • Contact
  • About Me
  • My WordPress plugins
  • Privacy Policy