A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Java
»
JSP
Author
I can not write in file
amir taghvayi
Ranch Hand
Joined: Sep 16, 2011
Posts: 54
posted
Sep 27, 2011 09:26:17
0
hi
i use tomcat5.32 + cpanel .
my code is :
<%
String
path = application.getRealPath("");
path +="/as.txt" ;
FileOutputStream
fos = new
FileOutputStream
(path);
fos.write("this is
test
?".getBytes());
fos.flush();
fos.close();
%>
when requested get this error :
java.io.FileNotFoundException
: /home/domainname/public_html/ROOT/as.txt (Permission denied)
java.io.FileOutputStream.open(Native Method)
java.io.FileOutputStream
.<init>(FileOutputStream.java:179)
java.io.FileOutputStream
.<init>(FileOutputStream.java:70)
org.apache.jsp.newjsp2_jsp._jspService(newjsp2_jsp.java:61)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
the perms is 0644 but my program can not write in own files .
please help me
!!!
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56554
14
I like...
posted
Sep 27, 2011 09:28:43
0
Please do not post the same question more than once.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: I can not write in file
Similar Threads
Tomcat + NetBeans deploying, need help.
Unable to compile class for JSP
iText: Digital signature
Create directories while uploading files in Servlet
Suddenly stopped working
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter