Base64 to pdf. After conversion - how to show pdf file ?
Hello all,
I have to show and save a pdf file from internal table ion base64 format.
I mean that I receive an internal table with data in base64 that represent a pdf file. I have
to convert it into pdf file than show and save the file.
I maked a conversion by:
CALL METHOD utility->decode_base64
EXPORTING
encoded = encoded
RECEIVING
decoded = decoded.
and, now my question is :
What I have to do about the string decoded ? I have to append it somewhere ?
and, how to create a pdf file from decoded string ?
tks a lot.
How to show PDF using SAPGui
Please check my reply in the following thread
a®
Similar Messages
-
Page numbers incorrect after conversion from Excel to pdf
Page numbers incorrect after conversion from Excel to pdf
""This above link (thread:834599) is from a case back in 2011 that claims to solve this problem, but it does not solve this problem. I think that customer only cared about having continuous page numbering, not discrete page numbering per sheet.
========================
I still have this issue in Acrobat XI and MS Office Professional Plus 2010. I keep upgrading to no avail. This regression has resulted in a huge time drain for me. If you fixed it, please explain how I can get my hands on the resolution.
Previous versions of Excel and Adobe Acrobat enabled flexibility around the "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) token, depending on context and usage. The "# of pages" token could represent EITHER the number of pages in the workbook OR the number of pages in the tab/sheet, depending on how you generated the PDF:
You could select "Selected Sheets" and then select all or some of the individual sheets in the workbook, and the PDF would honor the discrete numbering of each of the sheets, so the first page of each sheet was p1 and the "# of pages" was the number of pages in the sheet; not the number of pages in the workbook; or
You could select "Entire Workbook" and the PDF would honor continuous page numbers across all sheets, as a single document.
Now, it only honors the total number of pages in the workbook, regardless of the method you use to publish to PDF: saving as PDF, printing to PDF, using "createPDF" from Acrobat plugin to Excel's menu ribbon; selecting all sheets, some sheets, or Entire Workbook; automatic First page number or "1" under Page Setup > Page> First page number. (This last option, btw, does restart every sheet at p1, but it hardly makes sense if the total number of pages is still the total number in the workbook instead of the number in the sheet.)
I spent a lot of time trying each which way that the blog posts recommended and have tried this on multiple versions of Excel and Acrobat now.
NONE of these time-consuming experiments gave me what I wanted.They all insist that "Page #" of "Number of Pages" (Page &[Page] of &[Pages]) is the total number of pages in the workbook or the total number of pages in the selected sheets combined.
The numbering are correct in Excel Page Layout.
The same issue happens when using LibreOffice calc. (Although, I never tested with Libre Office before, so I don't know that it ever worked).
The workaround now is to create PDF for each spreadsheet one at a time, and then compile them using the Acrobat combine/binder feature. All alternatives are extremely time consuming and tedious. It used to be automatic. This is a major regression that has gone untreated for over a year now, maybe two years.
My task takes infinitely more time to complete than it did with previous versions of Acrobat. That means that days are added to my project, when the functionality used to enable a quick pdf generation that was ready for review, now I have to do this very manual time-consuming set of steps to generate a draft. As the project has grown and more tabs are added, my pdf-generation task takes that much longer. We require lots of drafts. It used to be easy and fast. Now it is hard and time-consuming.
In my opinion, the problem is not Excel; it is Acrobat because it was introduced with an upgrade in Acrobat, not an upgrade in Excel. The problem was introduced in Acrobat 9 or 10. Please provide a patch or add-on or something.If you are setting up the page numbers in Excel, the resulting PDF would display the the page numbers created in Excel. On Excel 2010 support page, (http://office.microsoft.com/en-us/excel-help/insert-and-remove-page-numbers-on-worksheets- HA010342619.aspx#BM2) is stated the following "tip" which indicates by default Excel 2010 starts numbering each tab with 1. Exel's workaround tip is below -
Set a different number for the starting page
Tip To number all of the worksheet pages in a workbook sequentially, first add page numbers to all worksheets in a workbook, and then use the following procedure to begin the page number for each worksheet with the appropriate number. For example, if your workbook contains two worksheets that with both be printed as two pages, you would use this procedure to begin the page numbering for the second worksheet with the number 3.
On the Page Layout tab, in the Page Setup group, click the Dialog Box Launcher next to Page Setup.
On the Page tab, in the First page number box, type the number that you want to use for the first page.
Tip To use the default numbering system, type Auto in the First page number box.
Also helpful in the same section is the note on viewing page numbers. To see if the page numbering dilemma originates in Excel make sure you are using the Page Layout View see below:
Hide All
If you want numbers shown on pages when you print a worksheet you can insert page numbers in the headers or footers of the worksheet pages. Page numbers that you insert are not displayed on the worksheet in Normal view — they are shown only in Page Layout view and on the printed pages.
Overall it may be easier not to create the page numbers in Excel but instead create then in Acrobat using the Headers and Footers option in Acrobat. I hope this helps - it sounds like a frustrating issue you are experiencing. -
How to Show Clob File in Report 6I ?
Hi i want to know how to show clob file in report 6i
Regards
Shahzaib ismailIn this situation I do not use headers at all. Insted of that I use union in a query :
select 'Firstname','Salary'
from dual
union all
select firstname, to_char(salary)
from employee;
The first record will work as header
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Suneel Vishwakarma ([email protected]):
Hello,
I want to generate excel format of my report. I did it using Delimited option but it was not same as it appears in my browser if I choose html format.all the labels repeat with each instance of the row .
Can you please give me the proper Solution.How should I proceed?
Thanks & Regds.
Suneel<HR></BLOCKQUOTE>
null -
I'd like to show PDF in a separate browser frame or in the same window, but at the same time with form screen. So, I'd like to have form in the left and showing pdf in the right. PDF is runing on web.show_document. I understand that this is imposible (btw: does anyone know when it's going to be posible?), but I'd like to figure out if someone have already made some kind of solution?
Thanks.I'd like to show PDF in a separate browser frame or in the same window, but at the same time with form screen. So, I'd like to have form in the left and showing pdf in the right. PDF is runing on web.show_document. I understand that this is imposible (btw: does anyone know when it's going to be posible?), but I'd like to figure out if someone have already made some kind of solution?
Thanks. -
How to show real file name on file download box when the file is downloaded
Here is my procedure for downloading from Oracle database to the client, the file is stored in a Blob field, a DAD was defined with no errors, in fact the upload works with no errors. The files are in text format, the field MIME_TYPE has the value 'text/plain' and DAD_CHARSET is ascii.
PROCEDURE download(p_filename IN VARCHAR2) IS
BEGIN
wpg_docload.download_file(p_filename);
EXCEPTION
WHEN OTHERS THEN
htp.p(sqlerrm);
RETURN;
END;
All functions are runing well, in fact it downloads with no errors but the file name that is suggested is the name of the package where the procedure es saved.
How can the real file name be showed on here? it is the parameter p_filename
I am using IE 6.0 SP 2, Oracle 10g Enterprise Edition Release 10.1.
Thanks for help
Yuri LopezI forgot something, i am using Forms [32 bits] Versión 9.0.4.0.19 and using web.show_document with a call to the procedure in the DB
-
Bridge CC: how to show hidden files?
My search returned hidden files.
Could you please show me how to reveal hidden files.
View | Show Hidden files IS checked.
Thanks.Open the Script Editor or AppleScript Editor in one of the subfolders of Applications and run the following:
tell application "Finder" to quit
if (do shell script "defaults read com.apple.finder AppleShowAllFiles") is "1" then
do shell script "defaults write com.apple.finder AppleShowAllFiles 0"
else
do shell script "defaults write com.apple.finder AppleShowAllFiles 1"
end if
delay 2
tell application "Finder" to run
If you change your mind later, run the script again.
(65149) -
Import window shows video thumbnails - How to show just file names ?
iMovie 10
OSX 10.10 Yosemite
Importing video from external USB HD, the import window shows thumbnails, how to configure it to show just file names ?This seems to have a lot of info.
http://homepage.mac.com/thgewecke/mlingos9.html
I got the same question marks when I used a translator on the net to make a file called hello world.txt and hello world.rtf.
doug-penningtons-Computer:~/Desktop dougpennington$ ls
Dictionary.app russian.txt ???????????? ??????.txt
Yahoo Search.app ???????????? ??????.rtf
Dictionary
russian.txt
Yahoo Search
привет мир
привет мир.txt -
How to show the file to client
When client clicks on the button or Browse button i want to show a Open Dialog box or Window will be opend in that window i want to show the file stored on server side(in particular folder only not all files on the server) for the selection after that i want to take file name(path of the file) selected by client.
thanks ...http://forum.java.sun.com/thread.jspa?threadID=714720&messageID=4131211#4131211
http://forum.java.sun.com/thread.jspa?threadID=715965&messageID=4136873#4136873
http://forum.java.sun.com/thread.jspa?threadID=717829&messageID=4145029#4145029
http://forum.java.sun.com/thread.jspa?threadID=719743&messageID=4153427#4153427
http://forum.java.sun.com/thread.jspa?threadID=719841&messageID=4153787#4153787
Seeing your other posts it looks like you have no clue. The server and client communicate
through http and are 2 different machines (unless you are debugging). You cannot use java.io.File
in an applet because it runs on the client and you want to list files on the server.
You cannot use <input type=file to list files on the server because it lists files on the client.
As suggested before you can use java.io.File on the SERVLET/JSP to generate html code listing the
files that the client wants to see, or use a database listing location of a file and user rights to it.
And please do not post the same queston so many times, if you don't understand something place a response
to an existing thread. -
How to show FTP Files in JTable, i gave codeeeee
hi to all,
plz any one can help me to show FTP Files in JTable, my FTP code is below,where i can upload and download files, i can list the files in JText Area , i want to show files in JTable, plz any on can post some code which can slove my problem
import java.net.*;
import java.io.*;
import java.util.*;
public class CFtp
static final boolean debug = false;
public static final int FTP_PORT = 21;
static int FTP_UNKNOWN = -1;
static int FTP_SUCCESS = 1;
static int FTP_TRY_AGAIN = 2;
static int FTP_ERROR = 3;
static int FTP_NOCONNECTION = 100;
static int FTP_BADUSER = 101;
static int FTP_BADPASS = 102;
public static int FILE_GET = 1;
public static int FILE_PUT = 2;
/** socket for data transfer */
private Socket dataSocket = null;
private boolean replyPending = false;
private boolean binaryMode = false;
private boolean passiveMode = false;
private boolean m_bGettingFile = false;
/** user name for login */
String user = null;
/** password for login */
String password = null;
/** last command issued */
public String command;
/** The last reply code from the ftp daemon. */
int lastReplyCode;
/** Welcome message from the server, if any. */
public String welcomeMsg;
/** Array of strings (usually 1 entry) for the last reply
from the server. */
protected Vector serverResponse = new Vector(1);
/** Socket for communicating with server. */
protected Socket serverSocket = null;
/** Stream for printing to the server. */
public PrintWriter serverOutput;
/** Buffered stream for reading replies from server. */
public InputStream serverInput;
/* String to hold the file we are up/downloading */
protected String strFileNameAndPath;
protected String m_strSource;
protected String m_strDestination;
public void setFilename( String strFile ) {
strFileNameAndPath = strFile;
String getFileName() {
return strFileNameAndPath;
public void setSourceFile(String strSourceFile) {
m_strSource = strSourceFile;
public void setDestinationFile(String strDestinationFile) {
m_strDestination = strDestinationFile;
public String getSourceFile() {
return m_strSource;
public String getDestinationFile() {
return m_strDestination;
void getCurrentDirectory() {
// return CSystem.getCurrentDir();
/** Return server connection status */
public boolean serverIsOpen() {
return serverSocket != null;
/**Set Passive mode Trasfers*/
public void setPassive(boolean mode) {
passiveMode = mode;
public int readServerResponse() throws IOException {
StringBuffer replyBuf = new StringBuffer(32);
int c;
int continuingCode = -1;
int code = -1;
String response;
try {
while (true) {
while ((c = serverInput.read()) != -1) {
if (c == '\r') {
if ((c = serverInput.read()) != '\n') {
replyBuf.append('\r');
replyBuf.append((char)c);
if (c == '\n')
break;
response = replyBuf.toString();
replyBuf.setLength(0);
try {
code = Integer.parseInt(response.substring(0, 3));
catch (NumberFormatException e) {
code = -1;
catch (StringIndexOutOfBoundsException e) {
/* this line doesn't contain a response code, so
we just completely ignore it */
continue;
serverResponse.addElement(response);
if (continuingCode != -1) {
/* we've seen a XXX- sequence */
if (code != continuingCode || (response.length() >= 4 && response.charAt(3) == '-')) {
continue;
else {
/* seen the end of code sequence */
continuingCode = -1;
break;
else if (response.length() >= 4 && response.charAt(3) == '-') {
continuingCode = code;
continue;
else {
break;
catch(Exception e) {
e.printStackTrace();
if (debug) {
// CSystem.PrintDebugMessage("readServerResponse done");
return lastReplyCode = code;
/** Sends command <i>cmd</i> to the server. */
public void sendServer(String cmd) {
if (debug) {
// CSystem.PrintDebugMessage("sendServer start");
serverOutput.println(cmd);
if (debug) {
// CSystem.PrintDebugMessage("sendServer done");
/** Returns all server response strings. */
public String getResponseString() {
String s = new String();
for(int i = 0;i < serverResponse.size();i++) {
s+=serverResponse.elementAt(i);
serverResponse = new Vector(1);
return s;
public String getResponseStringNoReset() {
String s = new String();
for(int i = 0;i < serverResponse.size();i++) {
s+=serverResponse.elementAt(i);
return s;
* issue the QUIT command to the FTP server and close the connection.
public void closeServer() throws IOException {
if (serverIsOpen()) {
issueCommand("QUIT");
if (! serverIsOpen()) {
return;
serverSocket.close();
serverSocket = null;
serverInput = null;
serverOutput = null;
protected int issueCommand(String cmd) throws IOException {
command = cmd;
int reply;
if (debug) {
// CSystem.PrintDebugMessage(cmd);
if (replyPending) {
if (debug) {
// CSystem.PrintDebugMessage("replyPending");
if (readReply() == FTP_ERROR) {
System.out.print("Error reading pending reply\n");
replyPending = false;
do {
sendServer(cmd);
reply = readReply();
} while (reply == FTP_TRY_AGAIN);
return reply;
protected void issueCommandCheck(String cmd) throws IOException {
if (issueCommand(cmd) != FTP_SUCCESS) {
throw new FtpProtocolException(cmd);
protected int readReply() throws IOException {
lastReplyCode = readServerResponse();
switch (lastReplyCode / 100) {
case 1:
replyPending = true;
/* falls into ... */
case 2://This case is for future purposes. If not properly used, it might cause an infinite loop.
//Don't add any code here , unless you know what you are doing.
case 3:
return FTP_SUCCESS;
case 5:
if (lastReplyCode == 530) {
if (user == null) {
throw new FtpLoginException("Not logged in");
return FTP_ERROR;
if (lastReplyCode == 550) {
if (!command.startsWith("PASS")) {
throw new FileNotFoundException(command);
else {
throw new FtpLoginException("Error: Wrong Password!");
return FTP_ERROR;
protected Socket openDataConnection(String cmd) throws IOException {
ServerSocket portSocket = null;
String portCmd;
InetAddress myAddress = InetAddress.getLocalHost();
byte addr[] = myAddress.getAddress();
int shift;
String ipaddress;
int port = 0;
IOException e;
if (this.passiveMode) {
// CSystem.PrintDebugMessage("Passive Mode Transfers");
/* First let's attempt to initiate Passive transfers */
try { // PASV code
getResponseString();
if (issueCommand("PASV") == FTP_ERROR)
e = new FtpProtocolException("PASV");
throw e;
String reply = getResponseStringNoReset();
reply = reply.substring(reply.indexOf("(")+1,reply.indexOf(")"));
StringTokenizer st = new StringTokenizer(reply, ",");
String[] nums = new String[6];
int i = 0;
while(st.hasMoreElements())
try
nums[i] = st.nextToken();
i++;
catch(Exception a)
a.printStackTrace();
ipaddress = nums[0]+"."+nums[1]+"."+nums[2]+"."+nums[3];
try
int firstbits = Integer.parseInt(nums[4]) << 8;
int lastbits = Integer.parseInt(nums[5]);
port = firstbits + lastbits;
catch(Exception b)
b.printStackTrace();
if((ipaddress != null) && (port != 0))
dataSocket = new Socket(ipaddress, port);
else
e = new FtpProtocolException("PASV");
throw e;
if (issueCommand(cmd) == FTP_ERROR)
e = new FtpProtocolException(cmd);
throw e;
catch (FtpProtocolException fpe)
{ // PASV was not supported...resort to PORT
portCmd = "PORT ";
/* append host addr */
for (int i = 0; i < addr.length; i++)
portCmd = portCmd + (addr[i] & 0xFF) + ",";
/* append port number */
portCmd = portCmd + ((portSocket.getLocalPort() >>> 8) & 0xff) + ","
+ (portSocket.getLocalPort() & 0xff);
if (issueCommand(portCmd) == FTP_ERROR) {
e = new FtpProtocolException("PORT");
portSocket.close();
throw e;
if (issueCommand(cmd) == FTP_ERROR) {
e = new FtpProtocolException(cmd);
portSocket.close();
throw e;
dataSocket = portSocket.accept();
portSocket.close();
}//end if passive
else
{ //do a port transfer
// CSystem.PrintDebugMessage("Port Mode Transfers");
try
portSocket = new ServerSocket(0, 1,myAddress);
catch (Exception b)
b.printStackTrace();
portCmd = "PORT ";
/* append host addr */
for (int i = 0; i < addr.length; i++) {
portCmd = portCmd + (addr[i] & 0xFF) + ",";
/* append port number */
portCmd = portCmd + ((portSocket.getLocalPort() >>> 8) & 0xff) + ","
+ (portSocket.getLocalPort() & 0xff);
if (issueCommand(portCmd) == FTP_ERROR) {
e = new FtpProtocolException("PORT");
portSocket.close();
throw e;
if (issueCommand(cmd) == FTP_ERROR) {
e = new FtpProtocolException(cmd);
portSocket.close();
throw e;
dataSocket = portSocket.accept();
portSocket.close();
}//end of port transfer
return dataSocket; // return the dataSocket
/** open a FTP connection to host <i>host</i>. */
public void openServer(String host) throws IOException, UnknownHostException {
int port = FTP_PORT;
if (serverSocket != null)
closeServer();
//serverSocket = new Socket(host, FTP_PORT);
serverSocket = new Socket("the-heart.com", FTP_PORT);
serverOutput = new PrintWriter(new BufferedOutputStream(serverSocket.getOutputStream()),true);
serverInput = new BufferedInputStream(serverSocket.getInputStream());
/** open a FTP connection to host <i>host</i> on port <i>port</i>. */
public void openServer(String host, int port) throws IOException, UnknownHostException {
if (serverSocket != null)
closeServer();
serverSocket = new Socket(host, port);
//serverSocket.setSoLinger(true,30000);
serverOutput = new PrintWriter(new BufferedOutputStream(serverSocket.getOutputStream()),
true);
serverInput = new BufferedInputStream(serverSocket.getInputStream());
System.out.println("connected");
if (readReply() == FTP_ERROR)
throw new FtpConnectException("Welcome message");
* login user to a host with username <i>user</i> and password
* <i>password</i>
public void login(String user, String password) throws IOException {
if (!serverIsOpen())
throw new FtpLoginException("Error: not connected to host.\n");
this.user = user;
this.password = password;
System.out.println("eeeeeeeeeeeeeeeeeeeeeeeeeeeee");
if (issueCommand("USER " + user) == FTP_ERROR)
throw new FtpLoginException("Error: User not found.\n");
if (password != null && issueCommand("PASS " + password) == FTP_ERROR)
throw new FtpLoginException("Error: Wrong Password.\n");
* login user to a host with username <i>user</i> and no password
* such as HP server which uses the form "<username>/<password>,user.<group>
public void login(String user) throws IOException
if (!serverIsOpen())
throw new FtpLoginException("not connected to host");
this.user = user;
if (issueCommand("USER " + user) == FTP_ERROR)
throw new FtpLoginException("Error: Invalid Username.\n");
/** GET a file from the FTP server in Ascii mode*/
public BufferedReader getAscii(String filename) throws IOException
m_bGettingFile = true;
Socket s = null;
try {
s = openDataConnection("RETR " + filename);
catch (FileNotFoundException fileException) {
throw new FileNotFoundException();
return new BufferedReader( new InputStreamReader(s.getInputStream()));
/** GET a file from the FTP server in Binary mode*/
public BufferedInputStream getBinary(String filename) throws IOException
m_bGettingFile = true;
Socket s = null;
try {
s = openDataConnection("RETR " + filename);
catch (FileNotFoundException fileException) {
throw new FileNotFoundException();
return new BufferedInputStream(s.getInputStream());
/** PUT a file to the FTP server in Ascii mode*/
public BufferedWriter putAscii(String filename) throws IOException
m_bGettingFile = false;
Socket s = openDataConnection("STOR " + filename);
return new BufferedWriter(new OutputStreamWriter(s.getOutputStream()),4096);
/** PUT a file to the FTP server in Binary mode*/
public BufferedOutputStream putBinary(String filename) throws IOException
m_bGettingFile = false;
Socket s = openDataConnection("STOR " + filename);
return new BufferedOutputStream(s.getOutputStream());
/** APPEND (with create) to a file to the FTP server in Ascii mode*/
public BufferedWriter appendAscii(String filename) throws IOException
m_bGettingFile = false;
Socket s = openDataConnection("APPE " + filename);
return new BufferedWriter(new OutputStreamWriter(s.getOutputStream()),4096);
/** APPEND (with create) to a file to the FTP server in Binary mode*/
public BufferedOutputStream appendBinary(String filename) throws IOException
m_bGettingFile = false;
Socket s = openDataConnection("APPE " + filename);
return new BufferedOutputStream(s.getOutputStream());
/** NLIST files on a remote FTP server */
public BufferedReader nlist() throws IOException
Socket s = openDataConnection("NLST");
return new BufferedReader( new InputStreamReader(s.getInputStream()));
/** LIST files on a remote FTP server */
public BufferedReader list() throws IOException
Socket s = openDataConnection("LIST");
return new BufferedReader( new InputStreamReader(s.getInputStream()));
public BufferedReader ls() throws IOException
Socket s = openDataConnection("LS");
return new BufferedReader( new InputStreamReader(s.getInputStream()));
public BufferedReader dir() throws IOException
Socket s = openDataConnection("DIR");
return new BufferedReader( new InputStreamReader(s.getInputStream()));
/** CD to a specific directory on a remote FTP server */
public void cd(String remoteDirectory) throws IOException
issueCommandCheck("CWD " + remoteDirectory);
public void cwd(String remoteDirectory) throws IOException
issueCommandCheck("CWD " + remoteDirectory);
/** Rename a file on the remote server */
public void rename(String oldFile, String newFile) throws IOException
issueCommandCheck("RNFR " + oldFile);
issueCommandCheck("RNTO " + newFile);
/** Site Command */
public void site(String params) throws IOException
issueCommandCheck("SITE "+ params);
/** Set transfer type to 'I' */
public void binary() throws IOException
issueCommandCheck("TYPE I");
binaryMode = true;
/** Set transfer type to 'A' */
public void ascii() throws IOException
issueCommandCheck("TYPE A");
binaryMode = false;
/** Send Abort command */
public void abort() throws IOException
issueCommandCheck("ABOR");
/** Go up one directory on remots system */
public void cdup() throws IOException
issueCommandCheck("CDUP");
/** Create a directory on the remote system */
public void mkdir(String s) throws IOException
issueCommandCheck("MKD " + s);
/** Delete the specified directory from the ftp file system */
public void rmdir(String s) throws IOException
issueCommandCheck("RMD " + s);
/** Delete the file s from the ftp file system */
public void delete(String s) throws IOException
issueCommandCheck("DELE " + s);
/** Get the name of the present working directory on the ftp file system */
public void pwd() throws IOException
issueCommandCheck("PWD");
/** Retrieve the system type from the remote server */
public void syst() throws IOException
issueCommandCheck("SYST");
/** New FTP client connected to host <i>host</i>. */
public CFtp(String host) throws IOException
openServer(host, FTP_PORT);
/** New FTP client connected to host <i>host</i>, port <i>port</i>. */
public CFtp(String host, int port) throws IOException
openServer(host, port);
public CFtp() {
// TODO Auto-generated constructor stub
public void SetFileMode(int nMode)
if (nMode == FILE_GET)
m_bGettingFile = true;
else
m_bGettingFile = false;
public static void main(String[] args){
CFtp ftp=new CFtp();
// Exception handlers
class FtpLoginException extends FtpProtocolException
FtpLoginException(String s)
super(s);
class FtpConnectException extends FtpProtocolException
FtpConnectException(String s)
super(s);
class FtpProtocolException extends IOException
FtpProtocolException(String s)
super(s);
}It's jakarta :)
The jakarta class:
/* <!-- in case someone opens this in a browser... --> <pre> */
import org.apache.commons.net.ftp.*;
import java.util.Vector;
import java.io.*;
import java.net.UnknownHostException;
/** This is a simple wrapper around the Jakarta Commons FTP
* library. I really just added a few convenience methods to the
* class to suit my needs and make my code easier to read.
* <p>
* If you want more information on the Jakarta Commons libraries
* (there is a LOT more you can do than what you see here), go to:
* http://jakarta.apache.org/commons
* <p>
* This Java class requires both the Jakarta Commons Net library
* and the Jakarta ORO library (available at http://jakarta.apache.org/oro ).
* Make sure you have both of the jar files in your path to compile.
* Both are free to use, and both are covered under the Apache license
* that you can read on the apache.org website. If you plan to use these
* libraries in your applications, please refer to the Apache license first.
* While the libraries are free, you should double-check to make sure you
* don't violate the license by using or distributing it (especially if you use it
* in a commercial application).
* <p>
* Program version 1.0. Author Julian Robichaux, http://www.nsftools.com
* @author Julian Robichaux ( http://www.nsftools.com )
* @version 1.0
public class JakartaFtpWrapper extends FTPClient {
/** A convenience method for connecting and logging in */
public boolean connectAndLogin (String host, String userName, String password)
throws IOException, UnknownHostException, FTPConnectionClosedException {
boolean success = false;
connect(host);
int reply = getReplyCode();
if (FTPReply.isPositiveCompletion(reply))
success = login(userName, password);
if (!success)
disconnect();
return success;
/** Turn passive transfer mode on or off. If Passive mode is active, a
* PASV command to be issued and interpreted before data transfers;
* otherwise, a PORT command will be used for data transfers. If you're
* unsure which one to use, you probably want Passive mode to be on. */
public void setPassiveMode(boolean setPassive) {
if (setPassive)
enterLocalPassiveMode();
else
enterLocalActiveMode();
/** Use ASCII mode for file transfers */
public boolean ascii () throws IOException {
return setFileType(FTP.ASCII_FILE_TYPE);
/** Use Binary mode for file transfers */
public boolean binary () throws IOException {
return setFileType(FTP.BINARY_FILE_TYPE);
/** Download a file from the server, and save it to the specified local file */
public boolean downloadFile (String serverFile, String localFile)
throws IOException, FTPConnectionClosedException {
FileOutputStream out = new FileOutputStream(localFile);
boolean result = retrieveFile(serverFile, out);
out.close();
return result;
/** Upload a file to the server */
public boolean uploadFile (String localFile, String serverFile)
throws IOException, FTPConnectionClosedException {
FileInputStream in = new FileInputStream(localFile);
boolean result = storeFile(serverFile, in);
in.close();
return result;
/** Get the list of files in the current directory as a Vector of Strings
* (excludes subdirectories) */
public Vector listFileNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (!files.isDirectory())
v.addElement(files[i].getName());
return v;
/** Get the list of files in the current directory as a single Strings,
* delimited by \n (char '10') (excludes subdirectories) */
public String listFileNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listFileNames(), "\n");
/** Get the list of subdirectories in the current directory as a Vector of Strings
* (excludes files) */
public Vector listSubdirNames ()
throws IOException, FTPConnectionClosedException {
FTPFile[] files = listFiles();
Vector v = new Vector();
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory())
v.addElement(files[i].getName());
return v;
/** Get the list of subdirectories in the current directory as a single Strings,
* delimited by \n (char '10') (excludes files) */
public String listSubdirNamesString ()
throws IOException, FTPConnectionClosedException {
return vectorToString(listSubdirNames(), "\n");
/** Convert a Vector to a delimited String */
private String vectorToString (Vector v, String delim) {
StringBuffer sb = new StringBuffer();
String s = "";
for (int i = 0; i < v.size(); i++) {
sb.append(s).append((String)v.elementAt(i));
s = delim;
return sb.toString();
and then there is the jar file:
http://jakarta.apache.org/site/downloads/
so for the wrapper.listfiles() you have to declare the wrapper as JakartaFtpWrapper. -
How to show pdf or word icons for a BLOB column in a report?
Hi,
I am getting interested for the blob columns, I have created some columns for storing some pdf drawings and pictures for specific items in a table, it is ok to show a text like 'download' or any other text in the report by setting the following blob attribute:
DOWNLOAD:TICKET_DETAILS:ATTACHMENT:TICKET_DETAILS_ID::MIME_TYPE:FILE_NAME:::inline:Download
but instead of texts, I would like to show a small pdf image for my Blob file, or a word image or Excel image, according to the different file type.
how to do that?
and instead of inline or attachment this two options, I would like when the user click the image of the file, the browser will show the image in a new window, or a new browser tab.
I tried the inline option for my file at Google Chrome, but when it showed the pdf file within the browser, I cannot get back to my app by clicking the 'backward' icon at the browser menu, it will stuck there and I have to close the broswer and then login to the app again, instead of simply returning back to the previous page within the app.
Please help me out.
Thanks
Peter Yawei . ZhangPlease try using a query like below for your report.
SELECT ticket_details_id,
CASE
WHEN NVL(dbms_lob.getlength(attachment),0) = 0 THEN NULL
ELSE
CASE
WHEN mime_type LIKE 'image%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/image_icon.gif" /></a>'
WHEN mime_type = 'application/pdf'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="#IMAGE_PREFIX#menu/pdf_32.gif" /></a>'
WHEN mime_type like '%ms-excel%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/excel_icon.gif" /></a>'
WHEN mime_type like '%msword%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/word_icon.gif" /></a>'
WHEN mime_type like '%ms-powerpoint%'
THEN '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/powerpoint_icon.gif" /></a>'
ELSE '<a href="'||apex_util.get_blob_file_src('P101_ATTACHMENT',ticket_details_id)||'" target="_blank"><img src="/i/office_icon.gif" /></a>'
END
END attachment
FROM ticket_details
WHERE ticket_details_id = :P102_TICKET_DETAILS_IDPlease note that I am using APEX_UTIL.GET_BLOB_FILE_SRC function to download the BLOB files. The first parameter of this function in my example query is P101_ATTACHMENT, which refers to page item of type "File Browse" on page 101, which is a DML form on table TICKET_DETAILS. Replace it with the appropriate page number. Please refer to "Working With BLOBs Procedurally" section of this APEX 3.2 documentation for more: [url http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/advnc.htm#sthref2199]http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/advnc.htm#sthref2199
Also I have the gif images representing various MIME types on my file server. For e.g., /i/excel_icon.gif. You can use #WORKSPACE_IMAGES# if you want to. -
How to show PDFs from a shared library?
Hi,
is it possible to share also PDFs from another library?
I am sharing my library from my own itunes account. It also contains PDFs and the whole library is shared. On the account of my wife my shared library shows up with all the music etc. However, it does not show the PDFs. Is this feature only available for eboks bought from the itunes store? How can I share my PDFs with iTunes?
Thanks in advance for any help on this!
FilipThis DLL is not a standard Windows DLL but a .Net Assembly. You need to use the .Net operators in LabVIEW to access it. Put the DLL in your LabVIEW project directory, drop a .Net contstructor node onto your diagram and then in the dialog that opens select the Browse button and point it to your DLL.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
How to show tiff files in sharepoint
Hello,
Ee have a bunch of scanned documents saved as tiff. How can I show them? Web app server won't preview them and this is a real big issue.
On the other hand, websio does the job, but I wouldn't like to have websio and web app server coexist.
Is there anoter solution? I'm conmortable for a web part put in viewitem.aspx that shows the tiff file underneath the metadaa.
ChristosHi,
Below links seems to be the similar issue,
http://social.msdn.microsoft.com/Forums/en-US/339fa5d3-1f77-462f-8b04-fd5efdf77479/opening-tiff-files-inbrowser?forum=sharepointgeneralprevious
Let us know if that helped you or not.
Regards,
Purvish Shah -
How to show the file contents in a streaming manner on the browser
Hi,
I have a log file which gets appended to by another program.
I need to show the contents of this log file in the browser window but in a streaming manner. Reading the file in one shot and refreshing the page every few seconds is not a solution as it makes the browser hang when the file size is huge. A unix tail functionality is also acceptable but it should be streaming. Would a servlet or applet do the trick?
Please advise!is your log file present on web/application server? if yes, you can do the following:
1. create a web page containing text area. (for displaying log file)
2. use XmlHttpRequstObject (Ajax) for querying the next available data from Servlet.
On the Serverside:
You can store the the FileScanner object in session scope. and use it to read the next available data and send it as response.
On the client Side(webpage/javascript)
read the contents of the response and append it to textarea.
In Simple words, I'd say AJAX is the way to go. -
ICloud - how to show stored files on my iPad / iPhone?
Hi, I thought I would be able to use my iCloud drive as my dropbox. But when I store some files on my mac on iCloud, how can I display it on my iPad? Do I need some app for that?
Hi ondrafromczech,
On your iPad, you access the files from within the Apps that support it.
iCloud Drive FAQ
How do I access all my files in iCloud Drive?
On your iPhone, iPad, or iPod touch with iOS 8, you can access your files from Apple apps like Pages, Numbers, and Keynote, or any apps that support iCloud Drive.
Take care,
Nubz -
How to show image file on Form using From Builder 10G
Hi
Well, Gurus... i want to attach picture at runtime on my Form. The user select name of article and it automatically attach the image in my image item on Form.
I'm using following code but it doesn't working.
PROCEDURE GET_ARTICLE_PIC IS
image_dir VARCHAR2(80) := 'D:\Images\';
photo_filename VARCHAR2(80);
BEGIN
:System.Message_Level := '25';
photo_filename := image_dir||:ITM_DIST_MST.ARTICLE_CODE||'.gif';
message(photo_filename);
message(photo_filename);
READ_IMAGE_FILE(photo_filename, 'GIF', 'ITM_DIST_MST.ARTICLE_IMG');
IF NOT FORM_SUCCESS THEN
MESSAGE('This Article has not Picture.');
END IF;
:SYSTEM.MESSAGE_LEVEL := '0';
END;
Please help, its urgentIs it throwing any error?
do you set correctly the ListUrl parameter? in this case it will be "PublishingImages"
Maybe you are looking for
-
So my ipod was stolen and i got it back but its still in his account
so my ipod was stolen and i got it back but its still in his account how do i get out of it
-
IPad cannot be found after trying to update to 7.1.1
While updating my iPad to 7.1.1 through my computer, it crashed and now it says I need to restore, but it won't let me. I cant even touch the iPad, it shows the plug into iTunes icons. itunes is recognizing the device to some extent because when I pl
-
Artwork not updating on iCloud
All my music is up in Apple's cloud, using iTunes Match. These are mostly MP3's that don't match anything in Apple's offerings, and have been uploaded from iTunes on my PC to the iCloud. I recently changed the album art that is embedded into the fil
-
Substitution exit for asset master is not getting triggered.
Hi I have created a substitution exit program ZGGBS000 having exit U215 and U216. If the Asset affirm value is initial , then WBS elemnt value will copied to asset affirm value field in the table ANLA.But it is not getting tiggered, when i am trying
-
Web Services with jaxm, it need a WSDL?
i am using jwsdp-1.1 and weblogic(in this container i have my Bussines logic), windows 2000. I only execute ant package and, ant install to use , neither deploy nor WSDL. I need a wsdl and deployment?