Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D7AFCEABA for ; Sun, 3 Feb 2013 20:47:43 +0000 (UTC) Received: (qmail 59883 invoked by uid 500); 3 Feb 2013 20:47:42 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 59818 invoked by uid 500); 3 Feb 2013 20:47:42 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 59810 invoked by uid 99); 3 Feb 2013 20:47:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2013 20:47:42 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of johansson.sven@gmail.com designates 209.85.212.182 as permitted sender) Received: from [209.85.212.182] (HELO mail-wi0-f182.google.com) (209.85.212.182) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Feb 2013 20:47:34 +0000 Received: by mail-wi0-f182.google.com with SMTP id hi18so972043wib.9 for ; Sun, 03 Feb 2013 12:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=VKm0lx9WEQeg8Fqaiok+qFdAnVQVYLMb4o+rk5YOT/I=; b=Fk5NqZuPm9PePU0AQuA41iorYdSN8nmUuUSf2HQZ5x3cVtW7+dzsQ/o8uBn8rQheys VRBpfGPK/54hbvWRF4Ic+ibytGmOGprP+bDj/931lFlvpt2Wx+uc2+V7Q4OgkADshlOT k6hCnG6KYpw1xVI7OzVwNd+CWOl+shWgzahVknCSRTAKDT8xKlk575+2L4RwpVybODSy 2HxAymsbeV7CJsdFx3Y5OkOFj9h6yT2f/Z/lMfniRo8P/hlR2Jtmj7hbOdeyS9jtlXKo 8yftRVMY5xIMsu67nZB7vWcne0N96HIRJkzRShaC6MTqh9b0mGemydsI10LWdB3P3dga YCdw== MIME-Version: 1.0 X-Received: by 10.180.84.165 with SMTP id a5mr6959853wiz.6.1359924434430; Sun, 03 Feb 2013 12:47:14 -0800 (PST) Received: by 10.194.22.1 with HTTP; Sun, 3 Feb 2013 12:47:14 -0800 (PST) In-Reply-To: References: Date: Sun, 3 Feb 2013 21:47:14 +0100 Message-ID: Subject: Re: [fileupload]java.io.fileNotFoundException : /home/abc/xyz.jpg (Permission denied) From: Sven Johansson To: Commons Users List Content-Type: multipart/alternative; boundary=f46d0418270ed5ea8404d4d8143b X-Virus-Checked: Checked by ClamAV on apache.org --f46d0418270ed5ea8404d4d8143b Content-Type: text/plain; charset=ISO-8859-1 On Sun, Feb 3, 2013 at 5:23 PM, arvind viswanathan < arvind.viswanathan@gmail.com> wrote: > Hi, > I am running tomcat7 instance in amazon linux. I am encountering the above > message when using file upload in my application deployed in it. I get the > following message. > java.io.fileNotFoundException : /home/abc/xyz.jpg (Permission denied) > when trying to save the image in /home/abc/ > My guess would be that you are running Tomcat as a different user than the one owning the home directory you are trying to write to. In that case it doesn't really have anything to do with tomcat or fileupload. Try saving the uploaded files to some common directory. Create a directory called.. say, /opt/myapp . give full access to everything and everyone by issuing the command "sudo chmod 777 /opt/myapp". Or if you are really sure that it's what you want to do, you could just go ahead and give the user running tomcat access to write in /home/abc. /S --f46d0418270ed5ea8404d4d8143b--