Status Upload
Hi,
I have used the BAPI 'BAPI_DOCUMENT_CREATE2' to create documents with their originals and classification. It is working fine. In the transaction CV03N, there is a tab for status, next to the classification tab. Could anybody tell me how do i upload this status log using the BAPI mentioned above?
Thanks in advance.
Regards
Nayan
Hi,
check this doc
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c08e5899-1444-2a10-e489-ef6ffbf13146
Regards,
Anirban
Similar Messages
-
GUI status upload and download....
Hi experts,
I am working upgradation project have problem with GUI status. How to upgrade GUI status from 4.6c to 6.0 ECC, Is there any upload and down load options.
Thanks & Regards.
KkHi,
check this doc
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c08e5899-1444-2a10-e489-ef6ffbf13146
Regards,
Anirban -
Gui status - upload / download
Hello All,
Is there any way where I can download GUI status from one system and upload it to another system ?
Thanks in advance,
Senthil GHi Senthil,
Gui status is tied directly to programs, so that said, you want have to tie this gui status to a program, then transport the program. So if you have a gui status that you want to use that is tied to standard program, create a "Z" program, then you can copy the gui status from the standard program to the "Z" program. Now you can transport the "Z" program to this other system, then you can copy the gui status from the "Z" program to where ever you need it in the other system. Make sense. I'm assuming that this other system is outside of the DEV->TST->PRD heiracrchy.
You can copy the gui status using SE41. Click User Interface, Copy, Status.
Regards,
Nitin. -
For some reason when I upload my files to the server, it
doesn't say what the file name is in the status area of the
sychronization box, it used to say what pages were being uploaded,
but now it doesn't. Does anyone have any idea why or how to fix it?
It normally wouldn't matter but now for some reason some of my
pages are unresolved when I go to upload them saying that the
remote and the local file do not match, but I'm not sure what pages
I need to fix. I appreciate any help. ThanksHi,
Yes, I thought i wasn't working (because in IDES worked different), but this is the normal behaviuor. When you upload the catalog the light is grey, after the creation of the article the light will turn green,or if the creation failed the light will turn red.
You can read note 1038571. -
Upload / download gui-status/dynpro when function group
Hi All,
I'm coding a program where I can download and upload reports and module pools but I tried to do the same with function groups and I found It is different to upload dynpro and gui staus when the objet to generate is a function group.
Could anyone help me a little in order to complete and finish this issue?
Below is shown the routines I coding in order to achive that:
For gui-status uploading I use:
CALL FUNCTION 'RS_CUA_INTERNAL_WRITE'
EXPORTING
program = prog
language = sy-langu
tr_key = tr_key
adm = adm4
TABLES
sta = sta4
fun = fun4
men = men4
mtx = mtx4
act = act4
but = but4
pfk = pfk4
set = set4
doc = doc4
tit = tit4
biv = biv46c
EXCEPTIONS
not_found = 1
OTHERS = 2.
For screen uploading I use:
GENERATE DYNPRO gs_d020s gt_d021s gt_d022s gt_d023s ID dynp_id
MESSAGE mess LINE line WORD word.
IF sy-subrc = 0.
EXPORT DYNPRO gs_d020s gt_d021s gt_d022s gt_d023s ID dynp_id.
ENDIF.
But both options don't work when uploading function groups
Regards...
Edited by: Rob Burbank on Jun 1, 2011 11:58 AM
Edited by: Kenneth Castañeda on Jun 2, 2011 7:31 PM
Edited by: Kenneth Castañeda on Jun 2, 2011 7:34 PMHi Kenneth,
sorry, it is really not obvious that [there is a link behind zsaplink|http://code.google.com/p/saplink/].
From the link:
"SAPlink is an open source project that aims to make it easier to share ABAP developments between programmers. It provides the ability to easily distribute and package custom objects."
This software allows you to up- and download all kinds of SAP objects. It is distributed under the GNU General Public License.
I think this is exactly what you are looking for - or I did not understand your question.
Regards,
Clemens -
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 -
File chunking and uploading/reasembling
i'm working on a chunked file uploader that talks to a nginx modul that handles resumable/chunked uploads.
right now i'm trying to verify that the file chunking process is working correctly. however i've run into some strange things with my local tests. for starters it works perfectly on all of the smaller file's i've tried. they've all passed the md5 checksum comparisons.
however for all of the larger files i've tried they fail the md5 checksum comparison, and a lot of the time the videos won't play. i've noticed that upping the chunk size from 5mb to 100mb has fixed the playback issue for at least one of the videos i've tested with.
as far as i can tell it's loading in the original file in chunks and storing those chunks into files. i can watch it's progress through the file and the numbers all match up as expected.
here's my source code for the chunking and rebuilding:
public function makeChunks():void{
status = "Preparing";
trace("VideoData::makeChunks");
fileStream = new FileStream();
fileStream.readAhead = chunkSize;
fileStream.addEventListener(ProgressEvent.PROGRESS,onOpenProgress);
fileStream.addEventListener(Event.COMPLETE,onOpenComplete);
fileStream.openAsync(file,FileMode.READ);
private function onOpenProgress(e:ProgressEvent):void{
if(fileStream.bytesAvailable >= fileStream.readAhead){
trace("onOpenProgress |",fileStream.position,"|",e.bytesLoaded,"/",e.bytesTotal,"(",file.size,")|----|",fileStr eam.bytesAvailable,"/",fileStream.readAhead);
var cChunk:ByteArray = new ByteArray();
fileStream.readBytes(cChunk);
trace("--",chunkIndex,"*",cChunk.length,chunkIndex*cChunk.length);
trace("--",fileStream.bytesAvailable,"/",fileStream.readAhead);
var tFile:File = File.applicationStorageDirectory.resolvePath(file.name+"_chunks/"+chunkIndex+".part");
var wStream:FileStream = new FileStream();
wStream.open(tFile,FileMode.WRITE);
wStream.writeBytes(cChunk);
wStream.close();
chunkIndex++;
//fileStream.position += currentChunk.length;
trace("---------------",chunkIndex,"",cChunk.bytesAvailable);
//dispatchEvent(new MediohEvent("LocalVideosChanged",true,true));
current_progress = e.bytesLoaded / e.bytesTotal;
private function onOpenComplete(e:Event):void{
trace("onOpenComplete |",fileStream.position,"/",file.size,"|",file.size-fileStream.position,"|----|",fileStrea m.bytesAvailable,"/",fileStream.readAhead);
if(fileStream.bytesAvailable > 0){
var cChunk:ByteArray = new ByteArray();
fileStream.readBytes(cChunk);
var tFile:File = File.applicationStorageDirectory.resolvePath(file.name+"_chunks/"+chunkIndex+".part");
var wStream:FileStream = new FileStream();
wStream.open(tFile,FileMode.WRITE);
wStream.writeBytes(cChunk);
wStream.close();
trace("chunking complete---------------",chunkIndex,"bytes length",cChunk.length,"bytes length",cChunk.length);
trace("--",chunkIndex,"*",cChunk.length,chunkIndex*cChunk.length);
trace("--",fileStream.bytesAvailable,"/",fileStream.readAhead);
fileStream = null;
chunk_path = file.name+"_chunks/";
needs_chunks = false;
status = "Uploading";
current_progress = 0;
dispatchEvent(new MediohEvent("LocalVideosChanged",true,true));
dispatchEvent(new Event("saveVideos",true,true));
rebuild();
private function rebuild():void{
var target_file:String = "C:\\Users\\sophia\\Videos\\backtogether\\"+file.name;
var folder:File = File.applicationStorageDirectory.resolvePath(chunk_path);
var filesFound:Array = folder.getDirectoryListing();
trace("blah",filesFound);
var bigFile:File = new File(target_file);
var wStream:FileStream = new FileStream();
wStream.open(bigFile,FileMode.WRITE);
for(var i:int = 0; i < filesFound.length; i++){
var fStream:FileStream = new FileStream();
fStream.open(filesFound[i],FileMode.READ);
var bytes:ByteArray = new ByteArray();
fStream.readBytes(bytes);
fStream.close();
wStream.writeBytes(bytes);
wStream.close();
status = "Complete";
current_progress = 1;
date_uploaded = new Date();
clearChunks();
dispatchEvent(new Event("uploadComplete",true,true));
dispatchEvent(new Event("saveVideos",true,true));i've found a work around. instead of splitting the file up into a bunch of smaller files that i can then read the bytes from to upload i just upload them as i read them from the file. and have it wait to processes the next block of bytes that get loaded until after the previous bytes finish uploading.
i also determined that the number of chunks effects my ability to put them back together again locally.
i tested with a file i had successfully uploaded before with a much smaller chunk size (1mb instead of 5mb) and it uploaded successfully but my local attempt to rebuild failed.
i'm still kinda currious as to why i can put together a file broken into a couple chunks but not one broken into many. -
11G Grid control - Target is temporarily in status pending state.
Hi,
I'm using 11G OMS, where at a point of time I can see many unknown targets with message "Target is temporarily in status pending state."
There are different databases running on different hosts are showing the same error.
Thanks
KSGKSG,
Can you try below commands on agent to get status & upload/reload , last upload time & target being monitored
Also have check in /etc/hosts of agent host should be in below format
<IP> hostname.domainname hostname
Check ping telnet for connectivity between agent & OMS
HTTP Console Port : 7789
HTTPS Console Port : 7800
HTTP Upload Port : 4890
HTTPS Upload Port : 4900
Agent Port : 3872
Repository Port : 1521
Enterprise Manager Central Console Port = 4889
Enterprise Manager Central Console Secure Port = 1159
emctl status agent
emctl upload
emctl reload
emctl config agent listtargets Thanks,
Ajay More
http://www.moreajays.com -
Submitted my first update to an app on the app store yesterday, and the update is still on status "Upload Received"
Is this normal? Shouldn't it be on "Waiting for Review" status by now?I contacted itunesconnect support about it. They said there was indeed an issue, and fixed it but didn't give any details beyond that.
-
Facebook app unable to load friends list
Hello everyone. About 3 days ago my facebook app stopped loading my friends list. I get a message saying "your friends list is unavailable". Because of this, I've been unable to post on someones wall, send a msg, or poke. The only thing I can do is upate my status, upload photos, and respond to a post someone sends me. I've search for a fix but can't find one. I've restarted the phone, reinstalled the app. Nothing is fixing it.
Only 2 things I can think of has worked for me when I had similar problem. 1. Clear Cache. 2. Log out of FB on your BB then log back in. You get to both of these in FB by pressing the menu key then scroll down to options and select one. Hope this helps.
Edit: One afterthought was to go to My Account in FB on your pc and click on the Mobile Tab. Then re-submit the mobile number for activation. It's worth a try.
Message Edited by mistergadget on 02-17-2009 09:20 AM -
How do i get my toolbar back on the iphone facebook app?
its disappeared and i cant write statuses, upload photos or check in. also when i click on other statuses the comment box is gone :-/
No idea. Probably the easiest solution is to delete it and redownload it. To delete it, tap and hold the FB icon until it wiggles, the tap the black "X", finish by tapping the home button.
-
Supplier /Customer MDS center-SAP EHS Management (Product Compliance)
Hello All
What is the difference between Supplier and Customer MDS center .
Functionally we are doing the same activites as mentioned below in both the centers.
1.Create and send material data sheets.
2. Accept or reject material data sheets.
3. Tracking the status of MDS
4. Importing the MDS into the system.
I would like to put my understanding with the scenario mentioned below
Suppose I am working in TIER1 company ( 1st level supplier to the OEM ). TIER 1 company inturn have many other suppliers ( TIER2 , 2nd level suppliers to OEM ) who may not interact directly with the OEM. So when I would be interacting with TIER2 for compliance data I would be using
Supplier MDS center and likewise with OEM it would be Customer MDS center.
Please let me know , if my understanding is right .
Cheers
SatishHi Satish,
Yes, your understanding is right.
You can imagine the Supplier MDS center as your IMDS inbox and the Customer MDS Center as the outbox.
You will use the Supplier MDS center to see the incoming supplier MDSs or published MDSs.
If you enabled IMDS status upload/download (on IMDS side) you can use the Supplier Center for accepting/rejecting MDSs. And you can import the MDS into EHSM.
From the Customer MDS center you can send or publish your own MDSs.
Kind regards,
Andreas -
IOS Update failed on Catalyst C2960S-48LPS-L
Hi Community,
i've got a little problem to update IOS 12.2(55)SE5 on a 2690S-49PLS-L switch
File: c2960s-universalk9-tar.150-2.SE6.tar
why? I took 2 Switches out of the box, one runs IOS 12,2 the other 15.0, stack doesn't work.
tried 3 options to upgrade:
- CNA 6.1: first Upgrade Status "uploading" next Error: failed to upgrade.
- Http/https and IE 11: looks the same, status "Loading to Switch", Error: upgrade was unsuccessful or aborted
- CLI: set first ip ftp username + password, then comand:
switch# archive download-sw /overwrite /reload ftp://*IP of FTP-Server*/Cisco/c2960s-universalk9-tar.150-2.SE6.tar
Error: Unable to create temp dir "flash:update"
i need some Ideas...
BR
SiggiError: Unable to create temp dir "flash:update"
Ok, the error message is very helpful.
To the switch that is exhibiting this error message, run this command: delete /f /r flash:update
Once the command has finished, run the "archive download-sw" again. -
Please Help Me - I am stuck with this problem for days
O.k I have posted couple of problems here. But the latest one is as follows
I trying to pass a Stiring Array from Java function to my native method. the native function in turn invokkes another function that takes a char [][] as its parameter. My native function basically converts teh jobjectarray into char [][] and then invoke the other function.
JNIEXPORT jboolean JNICALL
Java_copilotplus_DataTransferTab_GetStatus
(JNIEnv *env, jobject o, jobjectArray fn, jlongArray size)
char szStr[8][33];
int len = env->GetArrayLength( fn );
int i=0;
for( i=0; i < len; i++ )
jobject obj = env->GetObjectArrayElement(fn, i);
jstring str = (jstring)obj;
szStr[33] = (char)env->GetStringUTFChars( str, 0 );
//*file = szStr[i];
BOOL status = Upload(szStr);
return status;
BOOL Upload(char pFileName [][33])
return TRUE;
Now this compiles fine and makes a dll
But when I run my java program it gives me this error
HotSpot Virtual Machine Error, EXCEPTION_ACCESS_VIOLATION
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Error ID: 4F533F57494E13120E43505002D4
What am I doing wrong
Please Help
VaishaliThe problem was that I did not ahve any actual values in the String Array. I was doing like this initially
String []file = new String[8]
and then when i pass file to the dll it was trying to read something which was not there. That's why it was crashing.
But now I put some values in it and then it works fine. -
Correct use of Type declaration?
Hello,
I have a type declaration in a package like so:
type get_rec_type
IS
record
( upl_id table_name.id%TYPE
, doc_id table_name.eff_from%TYPE
);I have refered to this type in my procedure declaration like so:
PROCEDURE bulk_upload_prc
( p_rec OUT get_rec_type
);Is this correct?
The reason I ask is because I am getting the following error.
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'BULK_UPLOAD_PRC'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignoredThank You
Ben
Edited by: Benton on Nov 3, 2010 12:01 PMHi Toon,
I am attempting to run it by doing the following:
EXEC schemName.new_bulk_upload_pkg.bulk_upload_prc;And I am not supplying it any variables, because it should be getting them from the cursor that I have opened.
and here is the cursor
CURSOR c_get_rec_type RETURN get_rec_type;This is the package so far, I hope I am not giving you too much information ...
SPECIFICATION
CREATE OR REPLACE
PACKAGE NEW_BULK_UPLOAD_PKG
AS
-- DECLARE TYPES
type get_fbt_bulk_upload_rec_type
IS
record
( upl_id tableName.upl_id%TYPE
, doc_id tableName.doc_id%TYPE
, atr_id tableName.atr_id%TYPE
, reference tableName.reference%TYPE
, filename tableName.filename%TYPE
, mime_type tableName.mime_type%TYPE
, eff_from tableName.eff_from%TYPE
, eff_to tableName.eff_to%TYPE
, title tableName.title%TYPE
, comments tableName.comments%TYPE
-- DECLARE CURSORS
CURSOR c_get_fbt_bulk_upload_rec_type RETURN get_fbt_bulk_upload_rec_type;
PROCEDURE bulk_upload_prc
( p_rec OUT get_fbt_bulk_upload_rec_type
, p_blob OUT BLOB
, p_srcfile OUT BFILE
, p_max_rec OUT NUMBER
END NEW_BULK_UPLOAD_PKG;BODY
CREATE OR REPLACE
PACKAGE BODY NEW_BULK_UPLOAD_PKG
AS
CURSOR c_get_rec_type
RETURN get_rec_type
IS
SELECT upl_id
, doc_id
, atr_id
, reference
, filename
, mime_type
, eff_from
, eff_to
, title
, comments
FROM schemaName.tableName
WHERE status = 'NOT LOADED';
-- Bulk upload procedure.
PROCEDURE bulk_upload_prc
p_rec OUT get_rec_type ,
p_blob OUT BLOB ,
p_srcfile OUT BFILE ,
p_max_rec OUT NUMBER
IS
BEGIN
LOOP
FETCH c_get_rec_type INTO p_rec;
EXIT WHEN c_get_rec_type%NOTFOUND;
DBMS_LOB.CreateTemporary(p_blob, TRUE);
DBMS_LOB.Open(p_blob, dbms_lob.Lob_ReadWrite);
p_srcfile := Bfilename('UPLOAD_DIR', p_rec.filename);
DBMS_LOB.FileOpen (p_srcfile, dbms_lob.File_ReadOnly);
DBMS_LOB.LoadFromFile(p_blob, p_srcfile, DBMS_LOB.GetLength(p_srcfile));
INSERT
INTO dev_fbt_doc
filename ,
mime_type,
blob_content
VALUES
p_rec.filename ,
p_rec.mime_type,
EMPTY_BLOB()
-- Remark required
UPDATE schemaName.TableNameB
SET blob_content = p_blob
WHERE filename
LIKE p_rec.filename;
-- Get the DOC_ID of the record that was just inserted into TableNameB.
EXECUTE IMMEDIATE 'SELECT MAX(doc_id) FROM schemaName.TableNameB'
INTO p_max_rec;
-- Update the column named STATUS with the text UPLOADED to distinguish it from
-- those records that have not been uploaded (NOT LOADED).
UPDATE schemaName.tableName
SET status = 'UPLOADED'
WHERE upl_id = p_rec.upl_id;
-- Update the column named DOC_ID to record the assigned DOC_ID for the record
-- that was uploaded.
UPDATE schemaName.tableName
SET doc_id = p_max_rec
WHERE upl_id = p_rec.upl_id;
DBMS_LOB.FileClose(p_srcfile);
COMMIT;
END LOOP;
END bulk_upload_prc;
END NEW_BULK_UPLOAD_PKG;Thank You
Ben
Edited by: Benton on Nov 3, 2010 1:24 PM
Maybe you are looking for
-
Closing SKYPE URGENT TIME IS OF THE ESSENCE
All users should be aware that currently 3 out 5 methods that purport to close SKYPE DO NOT CLOSE IT. 1. LEFT Clicking the X in the top right corner of the SKYPE application DOES NOT EXIT SKYPE. 2. LEFT Clicking SKYPE then CLOSE of the SKYPE appli
-
Hey i need help with creating a quiz with scoring and all. I need a helping hand so if you can get me started that would help a lot. Use the Question class to define a Quiz class. A quiz can be composed of up to 25 questions. Define the add method of
-
How can I move my .mac e-mail to main apple id?
I have a Main apple ID that i've always used for itunes and app store purchases, but I had a mobile me account that upgraded to iCloud. I want to consolidate it to one ID and keep my email address. I know Apple say you can have one ID for iCloud and
-
How to view contenets of Queues/Topics?
I have been sending some XML files through my ESB flow to a JMS destination(Consumer). The flow will be successfull. But I cannot watch the contents of these JMS destination queues anywhere. I want to watch if the output data is correct in case I hav
-
Music app in iPad defaults back to itunes radio
Why does the music app in iPad default back to itunes radio every time i open it? That's very annoying. Can the default behavior be changed?