harry flower

Greenhorn
+ Follow
since Aug 29, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by harry flower

Hi,

I use ServerSocket to connect to the remote server.
My program is not a web application so I am not using tomcat.
It just FTP the file to local machine. Is there a way to search
for the file by ignoring the filename case-sensitivity?
Thanks.

Below are part of my codes:

/* @param dataSocket: The serverSocket created at local machine.
* @param pfilename: Remote file name
* @param pdestPath: Remote directory name
*/
private void getRemoteFile(ServerSocket dataSocket, String pfilename,
String pdestPath) throws IOException, FTPException
{
try
{
initializeGet(pfilename);
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(
pdestPath + File.separator + pfilename, false));
DataInputStream in = new DataInputStream(dataSocket.accept()
.getInputStream());
byte[] buffer = new byte[chunkSize];
int len = 0;
while ((len = in.read(buffer, 0, chunkSize)) > 0)
{
out.write(buffer, 0, len);
}
out.flush();
out.close();
in.close();
dataSocket.close();
}
}
14 years ago
Hi,

I wish to download a text file from a remote server.
As Unix is case-sensitive, is it possible to download a file
regardless of the case-sensitivity of its filename?
That means if the server store this file named "ABC.TXT",
so even if I input "abc.txt", I can still download the file.

Thanks to advise if you have some solution.
14 years ago
But where should I put "window.parent.location"? In "subtop.jsp"?
But where should I put "window.parent.location"? In "subtop.jsp"?
14 years ago
JSP
Hi,

I have a web page called "main.jsp" which contains 2 framesets. The top frameset point to "subtop.jsp" and the bottom frameset point to "subbottom.jsp". "subtop.jsp" contains textboxes and combobox to allow user to input their criteria in order to search for an item. "subbottom.jsp" will display the results after the search button is clicked. Whenever a user clicked on the combobox on "subtop.jsp", it will trigger to run a servlet.
I have also set a session timeout in "web.xml". When a session has timeout, I wish to display an error and get out of the frameset that contains "subtop.jsp" but I have no idea how I can do it? I have tried the http response.redirect in order to move to the main.jsp but I am still stuck in the top frame. Can anyone advise me? Thank you.
14 years ago
JSP
Hi,

I have a web page called "main.jsp" which contains 2 framesets. The top frameset point to "subtop.jsp" and the bottom frameset point to "subbottom.jsp". "subtop.jsp" contains textboxes and combobox to allow user to input their criteria in order to search for an item. "subbottom.jsp" will display the results after the search button is clicked. Whenever a user clicked on the combobox on "subtop.jsp", it will trigger to run a servlet.
I have also set a session timeout in "web.xml". When a session has timeout, I wish to display an error and get out of the frameset that contains "subtop.jsp" but I have no idea how I can do it? I have tried the http response.redirect in order to move to the main.jsp but I am still stuck in the top frame. Can anyone advise me? Thank you.
Then is there a java command to access the subdirectories in WEB-INF?
I tried to use this command: 'getServletContext().getRealPath("/")',
is it pointing to the correct location?
I am running my web application in Eclipse.
14 years ago
Then is there a java command to access the subdirectories in WEB-INF?
I tried to use this command: 'getServletContext().getRealPath("/")',
is it pointing to the correct location?
I am running my web application in Eclipse.
14 years ago
Yes but my concern is which directory in the web server should I temporary stored these files?
14 years ago
Yes but my concern is which directory in the web server should I temporary stored these files?
14 years ago
Hi,

I am writing a web application to be run in Unix Server.
I wish to save a file from a FTP server to the web server.
But this file is to be save temporary in the web server, make same updates and will be deleted after used.
As there might be many users downloading the same file but the
content of this file might be change differently depending on different users, so usually where is the best location in the web server to store this file separately for different users?

Thanks in advance.
14 years ago
Hi,

I am writing a web application to be run in Unix Server.
I wish to save a file from a FTP server to the web server.
But this file is to be save temporary in the web server, make same updates and will be deleted after used.
As there might be many users downloading the same file but the
content of this file might be change differently depending on different users, so usually where is the best location in the web server to store this file separately for different users?

Thanks in advance.
14 years ago
Now I actually encountered this error: "500 Illegal PORT command, EPSV ALL in effect". What could be the problem? Thanks.
Hi,

I am having some problem to get file from URL (of a unix server) with password.
I keep on getting this error: "FileNotFoundException"
However, if I enter the url in the Internet Explorer,
I am able to access the file.

My code is as follow:

...
BufferedInputStream input = null;
BufferedOutputStream output = null;

try {

String address = "ftp://username assword@myunixftpserver.domain.com/home/dir/myfile.zip";
URL url = new URL(address);
URLConnection conn = url.openConnection();

//I got the ERROR at this code below
input = new BufferedInputStream(conn.getInputStream());

...


What could be the possible problem?
Thanks in advance for your advise.

Best regards
[ September 10, 2007: Message edited by: harry flower ]
Hi,

I am having some problem to get file from URL (of a unix server) with password.
I keep on getting this error: "FileNotFoundException"
However, if I enter the url in the Internet Explorer,
I am able to access the file.

My code is as follow:

...
BufferedInputStream input = null;
BufferedOutputStream output = null;

try {

String address = "ftp://username assword@myunixftpserver.domain.com/home/dir/myfile.zip";
URL url = new URL(address);
URLConnection conn = url.openConnection();

//I got the ERROR at this code below
input = new BufferedInputStream(conn.getInputStream());

...


What could be the possible problem?
Thanks in advance for your advise.

Best regards
[ September 10, 2007: Message edited by: harry flower ]
14 years ago