View Webpage In Safari After FTP Upload.
After updating(Publishing) my website via Everweb Publisher, safari is not showing the new changes. On my smart phone and tablet and PC the changes are there. For some reason Safari is not seeing and displaying changes. Am I missing a setting?. If I click reset Safari then it shows the changes after everything has been reset.
24" iMac/ 2.8 GHz Intel Core 2 Duo
3 GB 800 MHz DDR2 SDRAM
Running Complete Fresh Install OS X 10.9.3 Mavericks
Thanks in advance
Jose'
Hi and Welcome to Apple Discussions..
I can view it no problem so try trouble shooting. BTW, beautiful web site!
From the Safari Menu Bar, click Safari / Empty Cache. When you are done with that...
From the Safari Menu Bar, click Safari / Reset Safari. Select the top 5 buttons and click Reset.
Go here for trouble shooting 3rd party plugins or input managers which might be causing the problem.
http://support.apple.com/kb/TS1594
Make sure Safari is running in 32-bit mode. Right or control click the Safari icon in the Applications folder, then click: Get Info In the Get Info window click the black disclosure triangle next to General so it faces down. Select 32 bit mode. Also, (in that same window) make sure Safari is NOT running in Rosetta.
~/Library/Cookies and move the Cookies.plist file to the Trash. Relaunch Safari.
Carolyn
Similar Messages
-
Hi from Germany. I used iweb 3.04 and OS X 10.6+ and everything worked fine on different websites, including German Umlaute ä, ö, ü, ß.
After upgrading to Lion all Umlaute are not correct spelled (strange letters) after ftp-upload on a linux-server (which is the same as before). Before upload these Umlaute are spelled correctly, but not after upload.
Trials were a) upload htaccess file b) use older iWeb 3.03 c) asking server administrator (answer: "use ae, oe, ue instead"), but nothing worked.
Any ideas or help?
Thank you very much, and excuse my english
PeterThe problem lies in the uploading of the files or the server itself. If the umlautes looked good on the server before then we have to think it's the uploading process. Try using the free FTP client Cyberduck to upload your site folder to your server. Then check to see if the rendering is correct.
What's the URL of your site so we can examine it first hand? -
Website Not Displaying After FTP Upload
I have recently built a HTML/CSS website with Dreamweaver CS5 as a redesign for a client - it is my first website built through DW - and uploaded all the files via FTP. I removed all the former files/pages and it says my files have uploaded to the remote server...but the website does not display when I go to the URL. Instead a 404 error page displays.
This is my very first time using FTP, so I have no idea what I am doing wrong. (FYI: I have cleared my cache.) I have a default index page...and it is located in a "Pages" folder. Do all my pages need to be out of this folder in order to be accessed?
The URL is http://www.4hislove.com
Here's a snapshot of my remote server/local files:
Thank you for your help. Please forgive my ignorance!You have no default page in the site root. You've put your index page into a subfolder called pages:
http://www.4hislove.com/pages/
For starters, you should move index.html to the site root - but you need to think carefully about how you want to organize your site files. -
Using WEB Output HTML Gallery and uploading using ftp upload the HTML page views correctly but images only display the alt tag in the browser window?
After a little investigation, I discovered that PNGs also do not render correctly in IE7 in similar circumstances.
I ended up using Levels in Photoshop to bring the output blacks up to "5", saved the images as PNGs, modified the HTML from .jpg to .png, and that seems to have covered up the problem well enough.
By the way, I did confirm that IE8 beta 2 renders the images correctly.
Brian -
Others can view my webpage in Safari, but I cannot
I have my own personal website www.naturalyoga.com which was created on WordPress. I own the domain name. On my Mac computer, I cannot view the webpage in Safari. However, it works in Firefox. Others have tried it as well and it also works in Explorer and Firefox on PC's. Another Mac user could view the webpage in Safari on their computer.
Would this indicate a break in the code somewhere? Or is there some confirgured wrong with my Mac that is not allowing me to view it?Hi and Welcome to Apple Discussions..
I can view it no problem so try trouble shooting. BTW, beautiful web site!
From the Safari Menu Bar, click Safari / Empty Cache. When you are done with that...
From the Safari Menu Bar, click Safari / Reset Safari. Select the top 5 buttons and click Reset.
Go here for trouble shooting 3rd party plugins or input managers which might be causing the problem.
http://support.apple.com/kb/TS1594
Make sure Safari is running in 32-bit mode. Right or control click the Safari icon in the Applications folder, then click: Get Info In the Get Info window click the black disclosure triangle next to General so it faces down. Select 32 bit mode. Also, (in that same window) make sure Safari is NOT running in Rosetta.
~/Library/Cookies and move the Cookies.plist file to the Trash. Relaunch Safari.
Carolyn -
Fix the: Cannot view PDFs in Safari Window after installing CS3
All,
To fix the problem of displaying PDF files in Safari after installing CS3.
Open Adobe Acrobat 8 and then go to the preference menu, on the left hand side look for internet, select this option and then UNCHECK the options to use to open PDFs.
Apply and quit Adobe Acrobat 8. Quit Safari if still running and then reopen. What Safari does now is use the default settings and will open the PDFs as before.If it's not essential that the Adobe plugin handles PDF files then try turning off the plugin support via Adobe Reader preferences -> Internet -> Unselect the option to handle PDF files (sorry, I'm not on a Mac to quote the exact text but it's words to that effect).
If no other plugins handle PDFs, Safari should pick up the slack and handle them natively. -
So, after talking with charter (who basically told me to get bent, talk to apple...), i'm of the persuasion that there seems to be a problem with Charter's Personal Web Space FTP Upload system, and Mac OS X. Here's the 411:
I go to ftp://webpages.charter.net, Mac OS X takes over and initializes an FTP connection with Charter. I type my user name and password in, and i get this great window that shows me my webspace (which is clear because i haven't uploaded anything yet). delighted that it works and it will be so much more conveineint to simply drag and drop my files from the computer to the new Charter FTP window i give one file a whirl.
Mac OS X says:
+"The Item "any old friggin thing" could not be moved because "webpages.charter.net" cannot be modified"+
"OK..." i say, "We'll see about THAT business..." and off i go to the Get info window to change the permissions so that i CAN change. no such luck, it doesn't even have a drop down, it says "You can only read".
What the heck?!
I try a third party FTP client and i can transfer files the old Anarchie way, ALL DAY LONG, NO PROBLEM. Why in the world can't i do the same thing from the Mac OS X FTP window? It makes no sense...
Help... Me... PLEASE!!!!Sorry to report, but Charter was right... FTP from the Finder is read Only... cannot Write, long standing issue... they tell me it's because of the inherent lack of Security via FTP, (it indeed is, but...).
Your choices are using a 3rd party Client, (which I prefer, TransmitX here, but lots like the free CyberDuck), or using Terminal to do it. -
Missing url share in safari after mavericks
I couldnt see share url part while using Safari after install Mavericks how can i see it?I checked menu,reading list etc.but there is nothing.
Hello seymassa
I know the article is not for the latest version of Safari, but if you go to the drop down menu View > Customize Toolbar… you should be able to add the Share button back in if it does not show up so you can share the link of a webpage.
Mac Basics: Safari 5.1
http://support.apple.com/kb/HT4550
Regards,
-Norm G. -
IWeb, Finder and FTP Uploads...
Hey folks...
I was wondering if anyone was aware of an app that integrates FTP uploading capabilities straight into Finder - as opposed to use a third party FTP application to upload files.
I would like to use iWeb to publish websites to my website's FTP account - via FTP, by using Finder (But, obviously Finder is only read-only FTP access).
Does an application like this exist?I don't know if this solves your problem, but I connect to an FTP server through Safari and it mounts on my dekstop - thus Finder. If I type the line below in Safari (substituting my information where it says "username, password, and FTP host), then the FTP volume will mount on my desktop (after a few seconds), and appear in the Finder. Depending upon on your privileges you should be able to drag files in and out of the window (or the volume in the finder).
The line looks like this (type in the URL of Safari):
ftp://username:password@hostname
Again, not sure if this is what you want. -
Big troubles with FTP upload since upgrade to leopard
Hello out there,
I made an upgrade from tiger to leopard 3 weeks ago (10.5.7) on my iMac (Intel - early 2006). Since this time I Have big troubles with ftp upload.
I'm using Cyberduck as FTP client and it worked very well before but since the upgrade it starts quick and falls down to a view kb after a view seconds. Sometimes it stops completely.
Target Server is checked and working well. Also the ISP is fine (tested with a windows machine).
As it is important for my business (photographer) I would appreciate if somebody can give me a quick hint how to solve this problem.
Thanks in advanceI am also experiencing this problem, but only (so far) with one hosting company of the many I FTP into (web designer). The symptoms are exactly as reported above. Files initially start uploading fine, then slow to a crawl and stall. This is the same regardless of FTP software. Error reports say the server is not responding.
This problem is the same using my daughter's computer (also running 10.5.7), but my son (being my son) hasn't updated his OS since 10.5.5 and I encounter NO problems whatsoever FTPing from his machine, nor from a PC.
It's only the uploads that seem to cause a problem. Communicating with the server to download, rename, move or delete files presents no issues.
(In trying to track down where the problem was, I also discovered that the traceroute command to any site on both 10.5.5 and 10.5.7 stalls at the modem, though pings work fine as does tracert from the PC.) -
Not able to view PDF in Safari 6.0.2
Hi,
Not able to view pdfs in my Safari 6.0.2. I get a black screen and the following message -The Adobe Acrobat/Reader selected for viewing PDF documents in browsers cannot be found at its installed location; it may have been moved or deleted. Please reinstall or repair the application. (16:9)
I am able to download and view the pdfs though. Hw do I solve the problem.
Thanks,Reinstall the latest version of Adobe Reader - http://www.adobe.com/products/reader.html - it will install the latest version of the "Adobe Acrobat NPAPI Plug-in, Version 11.0.01" and you'll be able to view any PDF file inline using Safari (Safari does have a 'built-in' PDF renderer that works for some files, but not for any AcroForms, etc.). And Preview is just about the worst PDF reader available - I would make sure that you set Adobe Reader to be your default application for viewing and interacting with PDF files.
Good luck - be sure and restart Safari after the plugin is intstalled. Call back should you have any problems.
Clinton -
Hi I am using a ftp class (known as FTPConnection) that i found on this site: http://www.nsftools.com/tips/JavaFtp.htm , and they only have an example of how to download a File through FTP and not upload one. I am in the proccess of making an FTP upload applet, and need some help on getting upload to work. I also need it to work on both a Pc and mac, so that may be attributing to the problem becuase i am currently on a mac which uses file:// instead of C:\\. Ill post the ftp class, and a snippet of my code that tries to upload a selected file.
FTPConnection
/* <!-- in case someone opens this in a browser... --> <pre> */
* File: FTPConnection.java
* Author: Bret Taylor <[email protected]>
* URL: http://www.stanford.edu/~bstaylor/cs/ftpconnection/FTPConnection.java.shtml
* see also <a href="http://www.nsftools.com/tips/JavaFtp.htm">http://www.nsftools.com/tips/JavaFtp.htm</a>
* $Id$
* Parts of this code were adopted from a variety of other FTP classes the
* author has encountered that he was not completely satisfied with. If you
* think more thanks are due to any particular author than is given, please
* let him know. With that caveat, this class can be freely distributed and
* modified as long as Bret Taylor is given credit in the source code comments.
* Modified by Julian Robichaux -- http://www.nsftools.com
* Added constructors, logout(), listFiles(), listSubdirectories(), getAndParseDirList(),
* processFileListCommand(), and overloaded getFullServerReply().
* Also added StringBuffer parameter options to transferData() and executeDataCommand()
* and did a few other little things.
import java.io.*;
import java.net.*;
import java.util.*;
* <p>A wrapper for the network and command protocols needed for the most common
* FTP commands. Standard usage looks something like this:</p>
* <pre> FTPConnection connection = new FTPConnection();
* try {
* if (connection.connect(host)) {
* if (connection.login(username, password)) {
* connection.downloadFile(serverFileName);
* connection.uploadFile(localFileName);
* connection.disconnect();
* } catch (UnknownHostException e) {
* // handle unknown host
* } catch (IOException e) {
* // handle I/O exception
* }</pre>
* <p>Most FTP commands are wrapped by easy-to-use methods, but in case clients
* need more flexibility, you can execute commands directly using the methods
* <a href="#executeCommand(java.lang.String)">executeCommand</a> and
* <a href="#executeDataCommand(java.lang.String,
* java.io.OutputStream)">executeDataCommand</a>,
* the latter of which is used for commands that require an open data port.</p>
* @author Bret Taylor
* @author Julian Robichaux
* @version 1.01
public class FTPConnection extends Object {
* If this flag is on, we print out debugging information to stdout during
* execution. Useful for debugging the FTP class and seeing the server's
* responses directly.
private static boolean PRINT_DEBUG_INFO = false;
* The socket through which we are connected to the FTP server.
private Socket connectionSocket = null;
private String username;
private String password;
private String host;
* The socket output stream.
private PrintStream outputStream = null;
* The socket input stream.
private BufferedReader inputStream = null;
* The offset at which we resume a file transfer.
private long restartPoint = 0L;
* Added by Julian: If this flag is on, we're currently logged in to something.
private boolean loggedIn = false;
* Added by Julian: This is the line terminator to use for multi-line responses.
public String lineTerm = "\n";
* Added by Julian: This is the size of the data blocks we use for transferring
* files.
private static int BLOCK_SIZE = 4096;
* Added by Julian: After you create an FTPConnection object, you will call the
* connect() and login() methods to access your server. Please don't forget to
* logout() and disconnect() when you're done (it's only polite...).
public FTPConnection ()
// default constructor (obviously) -- this is just good to have...
* Added by Julian: Allows you to specify if you want to send debug output to
* the console (true if you do, false if you don't).
public FTPConnection (boolean debugOut)
PRINT_DEBUG_INFO = debugOut;
public FTPConnection (String user, String pw, String host_)
username=user;
password=pw;
host=host_;
PRINT_DEBUG_INFO = false;
* Prints debugging information to stdout if the private flag
* <code>PRINT_DEBUG_INFO</code> is turned on.
private void debugPrint(String message) {
if (PRINT_DEBUG_INFO) System.err.println(message);
* Connects to the given FTP host on port f, the default FTP port.
public boolean connect(String host)
throws UnknownHostException, IOException
return connect(host, 21);
* Connects to the given FTP host on the given port.
public boolean connect(String host, int port)
throws UnknownHostException, IOException
connectionSocket = new Socket(host, port);
connectionSocket.setSoTimeout(10000);
outputStream = new PrintStream(connectionSocket.getOutputStream());
inputStream = new BufferedReader(new
InputStreamReader(connectionSocket.getInputStream()));
if (!isPositiveCompleteResponse(getServerReply())){
disconnect();
return false;
return true;
* Disconnects from the host to which we are currently connected.
static boolean URLexists(String URLName)
try
HttpURLConnection.setFollowRedirects(false);
// note : you may also need
// HttpURLConnection.setInstanceFollowRedirects(false)
HttpURLConnection con =
(HttpURLConnection) new URL(URLName).openConnection();
con.setRequestMethod("HEAD");
return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
catch (Exception e)
e.printStackTrace();
return false;
public String getSimpleFileName(File f)
String path=f.getPath();
String fileName=path.replace("\\", "/");
int slashPos = fileName.lastIndexOf("/");
fileName=fileName.substring(slashPos+1);
return fileName;
public String verifyFileName(String name)
int count=0;
//String url="http://chris-malcolm.com/images/"+URLEncoder.encode(name).replace("+", "%20");
while (URLexists("http://chris-malcolm.com/images/"+URLEncoder.encode(name).replace("+", "%20"))==true)
count++;
name=FileExt(name)[0]+"-"+count+"."+FileExt(name)[1];
return name;
public String[] FileExt(String fileName)
int dotPos = fileName.lastIndexOf(".");
fileName=fileName.replace("\\", "/");
int slashPos = fileName.lastIndexOf("/");
String extension, name;
if (slashPos==fileName.length()-1)
fileName=fileName.substring(0, fileName.length()-1);
slashPos=fileName.lastIndexOf("/");
extension="/";
name=fileName.substring(slashPos+1);
else if(dotPos==-1)
name=fileName.substring(slashPos+1);
extension="";
else
extension = fileName.substring(dotPos+1);
name=fileName.substring(slashPos+1, dotPos);
String[] output={name, extension};
return output;
String[] output={name, extension};
return output;
public void disconnect()
if (outputStream != null) {
try {
if (loggedIn) { logout(); };
outputStream.close();
inputStream.close();
connectionSocket.close();
} catch (IOException e) {}
outputStream = null;
inputStream = null;
connectionSocket = null;
* Wrapper for the commands <code>user [username]</code> and <code>pass
* [password]</code>.
public boolean login(String username, String password)
throws IOException
int response = executeCommand("user " + username);
if (!isPositiveIntermediateResponse(response)) return false;
response = executeCommand("pass " + password);
loggedIn = isPositiveCompleteResponse(response);
return loggedIn;
* Added by Julian: Logout before you disconnect (this is good form).
public boolean logout()
throws IOException
int response = executeCommand("quit");
loggedIn = !isPositiveCompleteResponse(response);
return !loggedIn;
* Wrapper for the command <code>cwd [directory]</code>.
public boolean changeDirectory(String directory)
throws IOException
int response = executeCommand("cwd " + directory);
return isPositiveCompleteResponse(response);
* Wrapper for the commands <code>rnfr [oldName]</code> and <code>rnto
* [newName]</code>.
public boolean renameFile(String oldName, String newName)
throws IOException
int response = executeCommand("rnfr " + oldName);
if (!isPositiveIntermediateResponse(response)) return false;
response = executeCommand("rnto " + newName);
return isPositiveCompleteResponse(response);
* Wrapper for the command <code>mkd [directory]</code>.
public boolean makeDirectory(String directory)
throws IOException
int response = executeCommand("mkd " + directory);
return isPositiveCompleteResponse(response);
* Wrapper for the command <code>rmd [directory]</code>.
public boolean removeDirectory(String directory)
throws IOException
int response = executeCommand("rmd " + directory);
return isPositiveCompleteResponse(response);
* Wrapper for the command <code>cdup</code>.
public boolean parentDirectory()
throws IOException
int response = executeCommand("cdup");
return isPositiveCompleteResponse(response);
* Wrapper for the command <code>dele [fileName]</code>.
public boolean deleteFile(String fileName)
throws IOException
int response = executeCommand("dele " + fileName);
return isPositiveCompleteResponse(response);
* Wrapper for the command <code>pwd</code>.
public String getCurrentDirectory()
throws IOException
String response = getExecutionResponse("pwd");
StringTokenizer strtok = new StringTokenizer(response);
// Get rid of the first token, which is the return code
if (strtok.countTokens() < 2) return null;
strtok.nextToken();
String directoryName = strtok.nextToken();
// Most servers surround the directory name with quotation marks
int strlen = directoryName.length();
if (strlen == 0) return null;
if (directoryName.charAt(0) == '\"') {
directoryName = directoryName.substring(1);
strlen--;
if (directoryName.charAt(strlen - 1) == '\"')
return directoryName.substring(0, strlen - 1);
return directoryName;
* Wrapper for the command <code>syst</code>.
public String getSystemType()
throws IOException
return excludeCode(getExecutionResponse("syst"));
* Wrapper for the command <code>mdtm [fileName]</code>. If the file does
* not exist, we return -1;
public long getModificationTime(String fileName)
throws IOException
String response = excludeCode(getExecutionResponse("mdtm " + fileName));
try {
return Long.parseLong(response);
} catch (Exception e) {
return -1L;
* Wrapper for the command <code>size [fileName]</code>. If the file does
* not exist, we return -1;
public long getFileSize(String fileName)
throws IOException
String response = excludeCode(getExecutionResponse("size " + fileName));
try {
return Long.parseLong(response);
} catch (Exception e) {
return -1L;
* Wrapper for the command <code>retr [fileName]</code>.
public boolean downloadFile(String fileName)
throws IOException
return readDataToFile("retr " + fileName, fileName);
* Wrapper for the command <code>retr [serverPath]</code>. The local file
* path to which we will write is given by <code>localPath</code>.
public boolean downloadFile(String serverPath, String localPath)
throws IOException
return readDataToFile("retr " + serverPath, localPath);
* Wrapper for the command <code>stor [fileName]</code>.
public boolean uploadFile(String fileName)
throws IOException
return writeDataFromFile("stor " + fileName, fileName);
* Wrapper for the command <code>stor [localPath]</code>. The server file
* path to which we will write is given by <code>serverPath</code>.
public boolean uploadFile(String serverPath, String localPath)
throws IOException
return writeDataFromFile("stor " + serverPath, localPath);
* Set the restart point for the next download or upload operation. This
* lets clients resume interrupted uploads or downloads.
public void setRestartPoint(int point)
restartPoint = point;
debugPrint("Restart noted");
* Gets server reply code from the control port after an ftp command has
* been executed. It knows the last line of the response because it begins
* with a 3 digit number and a space, (a dash instead of a space would be a
* continuation).
private int getServerReply()
throws IOException
return Integer.parseInt(getFullServerReply().substring(0, 3));
* Gets server reply string from the control port after an ftp command has
* been executed. This consists only of the last line of the response,
* and only the part after the response code.
private String getFullServerReply()
throws IOException
String reply;
do {
reply = inputStream.readLine();
debugPrint(reply);
} while(!(Character.isDigit(reply.charAt(0)) &&
Character.isDigit(reply.charAt(1)) &&
Character.isDigit(reply.charAt(2)) &&
reply.charAt(3) == ' '));
return reply;
* Added by Julian: Returns the last line of the server reply, but also
* returns the full multi-line reply in a StringBuffer parameter.
private String getFullServerReply(StringBuffer fullReply)
throws IOException
String reply;
fullReply.setLength(0);
do {
reply = inputStream.readLine();
debugPrint(reply);
fullReply.append(reply + lineTerm);
} while(!(Character.isDigit(reply.charAt(0)) &&
Character.isDigit(reply.charAt(1)) &&
Character.isDigit(reply.charAt(2)) &&
reply.charAt(3) == ' '));
// remove any trailing line terminators from the fullReply
if (fullReply.length() > 0)
fullReply.setLength(fullReply.length() - lineTerm.length());
return reply;
* Added by Julian: Gets a list of files in the current directory.
public String listFiles()
throws IOException
return listFiles("");
* Added by Julian: Gets a list of files in either the current
* directory, or one specified as a parameter. The 'params' parameter
* can be either a directory name, a file mask, or both (such as
* '/DirName/*.txt').
public String listFiles(String params)
throws IOException
StringBuffer files = new StringBuffer();
StringBuffer dirs = new StringBuffer();
if (!getAndParseDirList(params, files, dirs))
debugPrint("Error getting file list");
return files.toString();
* Added by Julian: Gets a list of subdirectories in the current directory.
public String listSubdirectories()
throws IOException
return listSubdirectories("");
* Added by Julian: Gets a list of subdirectories in either the current
* directory, or one specified as a parameter. The 'params' parameter
* can be either a directory name, a name mask, or both (such as
* '/DirName/Sub*').
public String listSubdirectories(String params)
throws IOException
StringBuffer files = new StringBuffer();
StringBuffer dirs = new StringBuffer();
if (!getAndParseDirList(params, files, dirs))
debugPrint("Error getting dir list");
return dirs.toString();
* Added by Julian: Sends and gets the results of a file list command,
* like LIST or NLST.
private String processFileListCommand(String command)
throws IOException
StringBuffer reply = new StringBuffer();
String replyString;
// file listings require you to issue a PORT command,
// like a file transfer
boolean success = executeDataCommand(command, reply);
if (!success)
return "";
replyString = reply.toString();
// strip the trailing line terminator from the reply
if (reply.length() > 0)
return replyString.substring(0, reply.length() - 1);
} else {
return replyString;
* Added by Julian: Gets a directory list from the server and parses
* the elements into a list of files and a list of subdirectories.
private boolean getAndParseDirList(String params, StringBuffer files, StringBuffer dirs)
throws IOException
// reset the return variables (we're using StringBuffers instead of
// Strings because you can't change a String value and pass it back
// to the calling routine -- changing a String creates a new object)
files.setLength(0);
dirs.setLength(0);
// get the NLST and the LIST -- don't worry if the commands
// don't work, because we'll just end up sending nothing back
// if that's the case
String shortList = processFileListCommand("nlst " + params);
String longList = processFileListCommand("list " + params);
// tokenize the lists we got, using a newline as a separator
StringTokenizer sList = new StringTokenizer(shortList, "\n");
StringTokenizer lList = new StringTokenizer(longList, "\n");
// other variables we'll need
String sString;
String lString;
// assume that both lists have the same number of elements
while ((sList.hasMoreTokens()) && (lList.hasMoreTokens())) {
sString = sList.nextToken();
lString = lList.nextToken();
if (lString.length() > 0)
if (lString.startsWith("d"))
dirs.append(sString.trim() + lineTerm);
debugPrint("Dir: " + sString);
} else if (lString.startsWith("-")) {
files.append(sString.trim() + lineTerm);
debugPrint("File: " + sString);
} else {
// actually, symbolic links will start with an "l"
// (lowercase L), but we're not going to mess with
// those
debugPrint("Unknown: " + lString);
// strip off any trailing line terminators and return the values
if (files.length() > 0) { files.setLength(files.length() - lineTerm.length()); }
if (dirs.length() > 0) { dirs.setLength(dirs.length() - lineTerm.length()); }
return true;
* Executes the given FTP command on our current connection, returning the
* three digit response code from the server. This method only works for
* commands that do not require an additional data port.
public int executeCommand(String command)
throws IOException
outputStream.println(command);
return getServerReply();
* Executes the given FTP command on our current connection, returning the
* last line of the server's response. Useful for commands that return
* one line of information.
public String getExecutionResponse(String command)
throws IOException
outputStream.println(command);
return getFullServerReply();
* Executes the given ftpd command on the server and writes the results
* returned on the data port to the file with the given name, returning true
* if the server indicates that the operation was successful.
public boolean readDataToFile(String command, String fileName)
throws IOException
// Open the local file
RandomAccessFile outfile = new RandomAccessFile(fileName, "rw");
// Do restart if desired
if (restartPoint != 0) {
debugPrint("Seeking to " + restartPoint);
outfile.seek(restartPoint);
// Convert the RandomAccessFile to an OutputStream
FileOutputStream fileStream = new FileOutputStream(outfile.getFD());
boolean success = executeDataCommand(command, fileStream);
outfile.close();
return success;
* Executes the given ftpd command on the server and writes the contents
* of the given file to the server on an opened data port, returning true
* if the server indicates that the operation was successful.
public boolean writeDataFromFile(String command, String fileName)
throws IOException
// Open the local file
RandomAccessFile infile = new RandomAccessFile(fileName, "r");
// Do restart if desired
if (restartPoint != 0) {
debugPrint("Seeking to " + restartPoint);
infile.seek(restartPoint);
// Convert the RandomAccessFile to an InputStream
FileInputStream fileStream = new FileInputStream(infile.getFD());
boolean success = executeDataCommand(command, fileStream);
infile.close();
return success;
* Executes the given ftpd command on the server and writes the results
* returned on the data port to the given OutputStream, returning true
* if the server indicates that the operation was successful.
public boolean executeDataCommand(String command, OutputStream out)
throws IOException
// Open a data socket on this computer
ServerSocket serverSocket = new ServerSocket(0);
if (!setupDataPort(command, serverSocket)) return false;
Socket clientSocket = serverSocket.accept();
// Transfer the data
InputStream in = clientSocket.getInputStream();
transferData(in, out);
// Clean up the data structures
in.close();
clientSocket.close();
serverSocket.close();
return isPositiveCompleteResponse(getServerReply());
* Executes the given ftpd command on the server and writes the contents
* of the given InputStream to the server on an opened data port, returning
* true if the server indicates that the operation was successful.
public boolean executeDataCommand(String command, InputStream in)
throws IOException
// Open a data socket on this computer
ServerSocket serverSocket = new ServerSocket(0);
if (!setupDataPort(command, serverSocket)) return false;
Socket clientSocket = serverSocket.accept();
// Transfer the data
OutputStream out = clientSocket.getOutputStream();
transferData(in, out);
// Clean up the data structures
out.close();
clientSocket.close();
serverSocket.close();
return isPositiveCompleteResponse(getServerReply());
* Added by Julian: Executes the given ftpd command on the server
* and writes the results returned on the data port to the given
* StringBuffer, returning true if the server indicates that the
* operation was successful.
public boolean executeDataCommand(String command, StringBuffer sb)
throws IOException
// Open a data socket on this computer
ServerSocket serverSocket = new ServerSocket(0);
if (!setupDataPort(command, serverSocket)) return false;
Socket clientSocket = serverSocket.accept();
// Transfer the data
InputStream in = clientSocket.getInputStream();
transferData(in, sb);
// Clean up the data structures
in.close();
clientSocket.close();
serverSocket.close();
return isPositiveCompleteResponse(getServerReply());
* Transfers the data from the given input stream to the given output
* stream until we reach the end of the stream.
private void transferData(InputStream in, OutputStream out)
throws IOException
byte b[] = new byte[BLOCK_SIZE];
int amount;
// Read the data into the file
while ((amount = in.read(b)) > 0) {
out.write(b, 0, amount);
* Added by Julian: Transfers the data from the given input stream
* to the given StringBuffer until we reach the end of the stream.
private void transferData(InputStream in, StringBuffer sb)
throws IOException
byte b[] = new byte[BLOCK_SIZE];
int amount;
// Read the data into the StringBuffer
while ((amount = in.read(b)) > 0) {
sb.append(new String(b, 0, amount));
* Executes the given ftpd command on the server and writes the results
* returned on the data port to the given FilterOutputStream, returning true
* if the server indicates that the operation was successful.
private boolean setupDataPort(String command, ServerSocket serverSocket)
throws IOException
// Send our local data port to the server
if (!openPort(serverSocket)) return false;
// Set binary type transfer
outputStream.println("type i");
if (!isPositiveCompleteResponse(getServerReply())) {
debugPrint("Could not set transfer type");
return false;
// If we have a restart point, send that information
if (restartPoint != 0) {
outputStream.println("rest " + restartPoint);
restartPoint = 0;
// TODO: Interpret server response here
getServerReply();
// Send the command
outputStream.println(command);
return isPositivePreliminaryResponse(getServerReply());
* Get IP address and port number from serverSocket and send them via the
* <code>port</code> command to the ftp server, returning true if we get a
* valid response from the server, returning true if the server indicates
* that the operation was successful.
private boolean openPort(ServerSocket serverSocket)
throws IOException
int localport = serverSocket.getLocalPort();
// get local ip address
InetAddress inetaddress = serverSocket.getInetAddress();
InetAddress localip;
try {
localip = inetaddress.getLocalHost();
} catch(UnknownHostException e) {
debugPrint("Can't get local host");
return false;
// get ip address in high byte order
byte[] addrbytes = localip.getAddress();
// tell server what port we are listening on
short addrshorts[] = new short[4];
// problem: bytes greater than 127 are printed as negative numbers
for(int i = 0; i <= 3; i++) {
addrshorts[i] = addrbytes;
if (addrshorts[i] < 0)
addrshorts[i] += 256;
outputStream.println("port " + addrshorts[0] + "," + addrshorts[1] +
"," + addrshorts[2] + "," + addrshorts[3] + "," +
((localport & 0xff00) >> 8) + "," +
(localport & 0x00ff));
return isPositiveCompleteResponse(getServerReply());
* True if the given response code is in the 100-199 range.
private boolean isPositivePreliminaryResponse(int response)
return (response >= 100 && response < 200);
* True if the given response code is in the 300-399 range.
private boolean isPositiveIntermediateResponse(int response)
return (response >= 300 && response < 400);
* True if the given response code is in the 200-299 range.
private boolean isPositiveCompleteResponse(int response)
return (response >= 200 && response < 300);
* True if the given response code is in the 400-499 range.
private boolean isTransientNegativeResponse(int response)
return (response >= 400 && response < 500);
* True if the given response code is in the 500-5ok i tried explaining th eproblem in the previous post, but i apologize if my explanation was poor. anyways, i tried to look into it further by doing a printStackTrace() and believe it may be a read error. here is my new updated snippet, and also a link to a screenshot ([click here for screenshot|http://img143.imageshack.us/my.php?image=picture4qr0.png]) of what the error looks like on my end. it seems like a socket is not being read, or maybe it is initialized properly. Again I apologize if my problem is vague, but I do appreciate your input. thanks.
updated code snippet
public void uploadFiles()
statusLabel.setVisible(true);
errorLabel.setVisible(true);
uploadButton.setVisible(false);
footer.setVisible(false);
holdingPanel.setVisible(false);
pbar.setVisible(true);
pbar = new JProgressBar();
pbar.setMinimum(0);
float Total=0;
for (int i=0; i<fileLengths.size(); i++)
if(((java.lang.Boolean)model.getValueAt(i,1)).toString().equals("true"))
Total+=Float.parseFloat((String)fileLengths.get(i));
pbar.setMaximum((int)Total);
String info="";
try
ftp=new FTPConnection(false);
ftp.connect("ftp.chris-malcolm.com");
if (ftp.login("chrismal", "***"))
statusLabel.setText("Status: Connected.");
info+="Successfully logged in!\n";
info+="System type is: " + ftp.getSystemType()+"\n";
info+="Current directory is: " + ftp.getCurrentDirectory()+"\n";
if (ftp.changeDirectory("/www/images/"))
info+="directory changed to: " + ftp.getCurrentDirectory()+"\n";
try
for (int i=0; i<allFiles.size(); i++)
if(((java.lang.Boolean)model.getValueAt(i,1)).toString().equals("true"))
String f=client.verifyFileName((String)model.getValueAt(i,0));
String f2=""+((File)allFiles.get(i)).getPath();
info+="filename: "+f2+"\n";
if (ftp.uploadFile(f2))
statusLabel.setText("Status: Uploading "+f+" - "+i+" of "+calculateTotalFiles()+" files(s)");
pbar.setValue(Integer.parseInt((String)fileLengths.get(i)));
else
errorLabel.setText("Error occured while uploading"+f2+"\n");
catch(Exception de)
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
de.printStackTrace(pw);
pw.close();
//errorLabel.setText("<html>ERROR:"+sw.toString().replace("\n", "<br>")+"</html>");
info+="Error: "+de.getMessage()+"\n";
info+="Trace: "+sw+"\n";
try { ftp.disconnect(); statusLabel.setText("Status: disconnected.");} catch(Exception e2) {};
else
info+="could not change directory\n";
else
info+="could not login";
catch (Exception e)
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
pw.close();
info+="Error: "+e.getMessage()+"\n";
info+="Trace: "+sw+"\n";
try { ftp.disconnect(); statusLabel.setText("Status: disconnected.");} catch(Exception e2) {};
errorLabel.setText("ERROR:"+info);
JOptionPane.showMessageDialog(this, info, "test", JOptionPane.PLAIN_MESSAGE);
try { ftp.disconnect(); statusLabel.setText("Status: disconnected.");} catch(Exception e2) {};
Edited by: cjm771 on Jul 13, 2008 7:23 PM -
Base filtering engine is preventing FTP uploads
Using win 8.1. Ftp uploads (from any ftp program, filezilla, winscp and with knowhow cloud backup) stalls after 2-3 files have been uploaded. A single large file will upload but not multiple small files. If I boot into windows safe mode the problem
does not occur, ftp works fine, always. In normal mode by eliminating one running component at a time I found that the base filtering engine appeared to be the only problem. If base filtering was running the ftp problem occurred, if not then ftp
was fine.
Can one repair or replace the base filtering engine?. I found this as it relates to win 7
FROM ONE OF YOUR OTHER THREADS:
you may download and apply the BFE service registry fix (#11) in this page: Miscellaneous Registry Fixes for Windows 7/XP/Vista - The Winhelponline Blog: LINK REMOVED (could not submit, Body text cannot contain images or links until we are able to verify
your account.)
Is that applicable for this problem in win 8.1?
I do understand the BFE is an important security issue. I have also scanned my system for viruses, I use defender (computer associates) anti virus and firewall, and spybot for malware. I can't specifically pinpoint the occurrence of the problem with
the installation of any specific new software program. I have disabled the defender firewall and virus software and that does not solve the problem. Disabling base filtering engine results in a functioning ftp, enabling results in
a stalled ftp.
Any help would be appreciated.Try this suggestion
http://social.technet.microsoft.com/Forums/en-US/d8e59632-fca9-4bbd-b748-881af144706a/access-denied-base-filter-engine?forum=winservergen
1. Browse to the location for the BFE service in the registry (HKLM\System\CurrentControlSet\Services\BFE\Parameters\Policy), right click and select permissions.
2. In the "Permissions for Policy" window, click advanced | Add.
3. Once the "Select Users, Computers or Group" box appears, change the "From this location:" to point to the local machine name.
4. After changing the search location, enter "NT Service\BFE" in the "Enter the object name to select" box and click "Check names" - this will allow you to add the BFE account.
5. Give the following privileges to the BFE account:
Query Value
Set Value
Create Subkey
Enumerate Subkeys
Notify
Read Control
After adding the BFE account to the registry key, please try to start the Base Filtering Engine service. -
Has anyone had trouble with safari after updating to ios 8 on ipad
I am having trouble viewing a web page through safari after updating to ios 8 on my ipad. On the left side of my screen is a list of my favorites leaving only 3/4 of the screen to view a web page. Before the ios 8 update when I clicked on the safari icon it took me to a full screen view of my favorites with icons.
Same issue here, seems to be fine on text based websites, but any with images on struggle to load.
im on 100mb fibre, and all sites work fone on other devices, just my iPad since upgrading
its loads the site slowly, displays about 3/4 of the page once loaded -
Can you block webpages with safari
i was wondering if there was a way to block certain webpages with safari, i kno that you can make it so that a user can only view certain webpages, but that would mean blocking everything but the page that i dont want viewed.
Hi yes you can but you need to have the administrator account and you can only specify pages for user accounts. If this is the case then:
In 'safari' go to 'preferences' and 'secuirty' tab. Click 'Enable parental controls'. However this only works in Safari. If you want to stop people viewing pages in other browsers you'll need to set-up on that application or prevent them from accessing it all together in System Preferences.
Hope this works
Stu
Maybe you are looking for
-
Hi, We are in the process of configuring LDAP for our Portal system (EP 7). We have choosen the data source, Microsoft ADS (Deep Hierachy) + Database. We have generated a XML file and modified accordingly, from the data source, and we got a message "
-
Loading a Previously Saved Task into LabView
I have created a digital generation task in LabView and saved it using DAQmx Save Task.vi. I am able to open and run my task in Measurement and Automation Explorer. Now I am wondering if it is possible to load this task back into LabView and run it i
-
Mssclamp not work in solaris 10
hello i can't set parament in ipnat.conf with mssclamp like this map sppp0 form xxx.xxx.xxx.xxx/xx to any -> xxx.xxx.xxx.xxx/xx mssclamp 1452 i set work before in solaris 9 anyone can help me...many thx
-
No audio or video when exporting movie
I have both CS5 and CS6, running on a mac with OSX 10.6.8 a 2.3 Ghz i7 processor and 8 Gig RAM I'm getting the same result in both CS5 and CS6, I'm trying to export an edit that was shot on a Canon 7D. When I choose "match sequence settings" the resu
-
Generate Scripts using DBCA in Slient install
Hello, I have a template to create databases using DBCA. I woule like to generate scripts in Slient mode, using the template and later execute the scripts manaully. I understand, I need a response file for the same. What parameter should I set in the