User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 428,639 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,987 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 1112 | Replies: 1
Reply
Join Date: Jan 2008
Posts: 1
Reputation: ravinderkadiyan is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ravinderkadiyan ravinderkadiyan is offline Offline
Newbie Poster

Help file handling in html and jsp

  #1  
Jan 31st, 2008
in html body
<form method="get" action="MovieTiming.jsp">
<table cellspacing="0" cellpadding="0" border="2" style="width:50%; height: 400px;" bgcolor="pink">
<tr style="height:4px;">
<td id="Date" colspan="5">
Please input date (yyyymmdd)<input name="Date" type="text" size="8" maxlength="8" value="<%=date%>"></input>
<button type="submit" value="Submit">Get Movies List</button>
</td>
<td>
<button onclick=fileWrite();>save file</button>
<input type="file" id="loc" name="loc" >[/b]</input>


</td>
</tr>
<tr bgcolor="white">
<td id="output" colspan="10" style="height:400Px;">&nbsp;</td><td><textarea id="out" name="out" rows=20 cols=20 ></textarea></td>
</tr>
</table>
</form>




function fileWrite
{
<%
String loc = request.getParameter("file");
String func = request.getParameter("out");
if(func!=null)
{

File strFile = new File(loc);
Writer objWriter = new BufferedWriter(new FileWriter(strFile));
objWriter.write(func);
objWriter.flush();
objWriter.close();
}
%>
}


but this code is throwing exception whenever i click on save as button says that no such file exist.
is there any other way of write data to the file using html javascript or jsp(embed in html)
prefer javascript

please help
please help
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 336
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 32
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: file handling in html and jsp

  #2  
Feb 1st, 2008
check the location, may be there is some permission problem in server, there u have to put file read/write permission some time.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 1:06 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC