Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet File location in FileOutputStream
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Jagadeesh
File location in FileOutputStream
0 Answer(s)      4 years and 4 months ago
Posted in : JSP-Servlet


Hai,

For uploading a file i used the FileOutputStream() method. And uploading works perfectly. This method allows parameter as file name or the full path(that is from the drive letter. For example-->"C:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/mca2006sfssjc.co.in/stud/images/"+num+"."+ext) is required.

Giving full path will not work in another machine (that is software installing server machine). And if i give the file name only, it stores or uploads the file to the folder
C:\Program Files\Apache Software Foundation\Tomcat 6.0.
PROBLEM CASE:
Now, i need a method to specify a location to store the file which is uploaded. I required to store the file at

C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\mca2006sfssjc.co.in\stud\images

by changing the location to the folder "images" instead of giving this full path.

Your previous answer can be used to store file object in a database column of data type "File". I need to change the location of the file to be stored in the ordinary file format. Thanks for your previous reply. Expecting a suitable reply.

Advertisement
View Answers

Related Tutorials/Questions & Answers:
File location in FileOutputStream - JSP-Servlet
File location in FileOutputStream  Hai, For uploading a file i... a method to specify a location to store the file which is uploaded. I required... to change the location of the file to be stored in the ordinary file format. Thanks
How to write to file using FileOutputStream
How to write to file using FileOutputStream  Hi friends, Please help me in java program. How to write to file using FileOutputStream? thanks,   Hi, To write a file using FileOutputStream, we have to use
Advertisements
Java Write To File FileOutputStream
Java Write To File FileOutputStream In this tutorial you will learn how to write to file using FileOutputStream. Write to file using FileOutputStream you... FileOutputStream(String name) (this constructor creates the file with the name
Struts properties file location - Struts
Struts properties file location  Hi, Where struts properties file stored in web application. I mean which location. Thank u   Hi Friend, The struts.properties file can be locate anywhere on the classpath
FileOutputStream example code
Writing a file using FileOutputStream.... The OutputStream abstract class is used to write data to a file. The FileOutputStream.... The FileOutputStream  is used to write data to a file. For writing data like bytes, integers
fileoutputstream example
to a file. The FileOutputStream is the subclass of the OutputStream abstract class. The FileOutputStream is used to write data to a file than make the text...("The FileOutputStream is used to write data to a file."); System.out.println
Apache HSSF Jar file location
Apache HSSF Jar file location  where can i get jar files for apache hssf
How to downloads an application of the file from remote location?
How to downloads an application of the file from remote location?  Hi, Can help me How to downloads an application of Java file from remote... an application of file in the remote location. Plz visit this link for how to download
How to get the full path location using <input type=file>
How to get the full path location using input type=file  Hi. I have used input type=file> in HTML to select an image. But it selects only the image but not with its full path location. how to do it? Thanks in advance
Hot to Upload TIFF file to a sepcified location - JSP-Servlet
Hot to Upload TIFF file to a sepcified location  Hello everyone I have a serious doubt here which i need to solve as soon as possibe my query is i need to upload a TIFF file to a specified folder location on any other
FILEOUTPUTSTREAM and FILEINPUTSTREAM - Java Beginners
FILEOUTPUTSTREAM and FILEINPUTSTREAM  Using FILEOUTPUTSTREAM and FILEINPUTSTREAM provide code that will write bytes to file and read them back.../example/java/io/java-read-file-line-by-line.shtml Hope that the above links
FileOutputStream - JSP-Servlet
FileOutputStream  When uploading a file in JSP through FileOutputStream object it requires the full file path to be given. Otherwise it shows an error as writing the file with the already existing one and writing the ontent
Java FileOutputStream Example
facilitate to write output stream data to a file. The FileOutputStream writes... are as follows : Constructor Name Description FileOutputStream(File... data to a specified file (File object). FileOutputStream(File file
How to read a log file from server location and send a mail when exception occurs.
How to read a log file from server location and send a mail when exception occurs.  HI, How can i read the 2GB to 4GB log file from server. and i need to send a mail when exception occurs. Thanks Rajeev
Location Reminder
Location Reminder  Hi, i am planing to do a project called location... mark thar place in my mobile, and later if i visit that location,my mobile has to give a reminder. How to mark a location on mobile using GPS? Please give me
cursor location
cursor location   hi,please how to change cursor location by java code ,i use this code but not change the location JTextArea a=new JtextArea(); if(resultText.equalsIgnoreCase("class")){ a.append("a { \n }"); PointerInfo
location - MobileApplications
location  I want to do project in which when i go to college my mobile should get automatically to silent mode using the location where the college... location that come on our mobile display and silent the mobile. im new to J2ME
mkmapkit location search
mkmapkit location search  How to create a location search function that will allow the current location search on the MKMapKit
iphone location framework
iphone location framework  Which framework do i need to add to get the iphone current location in iPhone frameworks?   Add core location to your existing frameworks. CoreLocation.framework   
PDF gets launched at server location only
: PdfWriter.getInstance(document, new FileOutputStream(file_name); document.open...PDF gets launched at server location only  Hi, I have an application...().exec("rundll32 url.dll,FileProtocolHandler "file_name"); Problem is, when I
mkmapview zoom to current location
mkmapview zoom to current location  How can i zoom map to the current location
j2me location updates programming
j2me location updates programming  kindly please, assist me with with a j2me code for obtaining and sending GPS location updates periodicaly to the server IE; LATITUDE, LONGITUDE, SPEED, TIME. Am using netbeans IDE and PHP
Remote Location Handeling - RMI
Remote Location Handeling  I have application where I want main control from one location and have to connect two more locations remotly and have... location
Location Api - MobileApplications
Location Api  I am using following code to get coordinates of location in gps. On emulator in netbeans it shows me output as 2.0 2.0... a location provider: Criteria cr= new Criteria(); public void
timezone_location_get
timezone_location_get() Function in PHP timezone_location_get alias DateTimeZone::getLocation returns location information for a timezone including country code, latitude/longitude and comments. Syntax of timezone_location_get
Location finding error - JSP-Servlet
Location finding error  Location needs from drive name: My file uploading program has an error. It requires the location should be given from... the error as file not found. Below is the coding.The problem line is marked
Automatic Vehicle Location Advantage,Automatic Vehicle Location,Vehicle Location
Automatic Vehicle Location Advantage     ... Location or AVL is a system primarily used in tracking vehicles, freight... Better security for driver as well as travelers by enabling faster location
JavaScript method location
JavaScript method location         ... using location property of the window object. One of them is location.href which
Program in javascript to show the current location
Program in javascript to show the current location  Hi All, Actually in my application ..i wanted to updated the current location each time it gets... location in JavaScript? Thanks
Java Get Class Location
Java Get Class Location   ... location. For this, we have used the classes URL and ClassLoader. The class...(classLocation) returns the location of the class.  import 
How to Write to a File in Java
In this Java tutorial, we will demonstrate how to write to a file in Java... will be able to use OutputStreamWriter on a FileOutputStream classes to write data to a file from Java program. To write the Java Write To File we will use two
Advertisements
 

 

 

DMCA.com