Problem in uploading a file using Ws_upload.
Hi Experts,
I am using WS_UPLOAD for uploading .xls file into SAP Standard table T558A.
Problem is file is not uploaded to DB table.....getting error like
ERROR DURING FILE UPLOAD/DOWNLOAD as pop up message.....
can any boady please help on this issue.
Regards,
Praveena.
Hi,
If you want to upload the data using EXCEL file use the function module ALSM_EXCEL_TO_INTERNAL_TABLE.
Examples for ALSM_EXCEL_TO_INTERNAL_TABLE.
http://wiki.sdn.sap.com/wiki/display/Snippets/Howtouse+FM'ALSM_EXCEL_TO_INTERNAL_TABLE'
Similar Messages
-
Problem in Uploading excel file using WebDynpro for Java
Hi All
I have followed for Uploading excel file using WebDynpro for Java added by Tulasi Palnati
I done all, but I'm getting 500 Exception please contact u r system admin meag at run time also Jxl/Workbook class not found msag but i downloaded Jxl.jar file and there is no error signals in coding part. How can I solve the Problem.
Thanks
PolakaPlease ask the people in the Web Dynpro Java forum for a solution.
-
Error!! uploading .txt file using WS_upload
Hi Friends,
I am trying to upload a .txt file with 5 fields into a ztable using WS_upload. In debug mode i see that the internal table itab has all the fields clustered together seperated by a # symbol. How do i remove this # symbol so that i can upload it into ztable properly .
For eg the error i m getting is
ibm#1042#krj#04-19-2006#PS. All these 5 fields get clustered under material column and not in their respective columns.
Your opinion and advice is greatly appreciated .
Thank youSuppose you have the data from the file in i_text and i_vendor is a structure similar to the database, then you use the following logic to split the text with hash as delimiter.
loop at i_text.
split i_text-text at '#' into i_vendor-lifnr
i_vendor-ekorg
i_vendor-ktokd
i_vendor-name1
i_vendor-sortl
i_vendor-land1
i_vendor-spras
i_vendor-waers.
append i_vendor.
clear :i_vendor,
i_text.
endloop.
Let me send you a sample code. Let me know if this helps.
Award points if the answer helped you !
Session Method: ( Batch Input)
3 Function Modules are there.
1) BDC_OPEN_GROUP
2) BDC_INSERT
3) BDC_CLOSE_GROUP
Instead of all the Call Transactions we use the Function modules here.
1) Go for MK01
2) Go for recording. M4567,0001,0001 enter; test1, abcd, us, en, enter; usdollars; save.
3) Save and come back.
4) Select Vendor and Click on PROGRAM button . Stest_01
5) Select Transfer from recording button.
6) Save as local object
7) Copy the code into a Report program and execute it.
Example:
1) Create a text field having the following entries
t3456,0001,0001,testt3456,abcd123,US,E,USD and save the entries for 4-5 lines of these type.
2) Create a Program.
Report ZBDC_MK01.
*& Report ZBDC_MK01
REPORT ZBDC_MK01.
* Internal table for file
data : begin of i_text occurs 0,
text(255) type c,
end of i_text.
* Internal table for MK01 Transaction
data : begin of i_vendor occurs 0,
lifnr(10) type c,
ekorg(4) type c,
ktokd(4) type c,
name1(40) type c,
sortl(10) type c,
land1(3) type c,
spras(1) type c,
waers(3) type c,
end of i_vendor.
* Internal table for BDCDATA
data i_bdcdata like bdcdata occurs 0 with header line.
data : v_repid like sy-repid.
parameters p_file like rlgrap-filename.
INITIALIZATION.
v_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = v_repid
* * DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
start-of-selection.
* Get the data from file to internal table
perform get_data.
* Open the session
perform open_session.
* Process the bdcdata
perform process_bdcdata.
* Call the close_group
perform close_group.
*& Form get_data
* WS_UPLOAD FM
FORM get_data .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = p_file
FILETYPE = 'ASC'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* DAT_D_FORMAT = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = i_text
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
loop at i_text.
split i_text-text at ',' into i_vendor-lifnr
i_vendor-ekorg
i_vendor-ktokd
i_vendor-name1
i_vendor-sortl
i_vendor-land1
i_vendor-spras
i_vendor-waers.
append i_vendor.
clear :i_vendor,
i_text.
endloop.
endif.
free: i_text.
ENDFORM. " get_data
*& Form open_session
* text
FORM open_session .
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
* DEST = FILLER8
GROUP = 'VENDOR_MK01'
* HOLDDATE = FILLER8
KEEP = 'X'
USER = sy-uname
* RECORD = FILLER1
* PROG = SY-CPROG
* IMPORTING
* QID =
EXCEPTIONS
CLIENT_INVALID = 1
DESTINATION_INVALID = 2
GROUP_INVALID = 3
GROUP_IS_LOCKED = 4
HOLDDATE_INVALID = 5
INTERNAL_ERROR = 6
QUEUE_ERROR = 7
RUNNING = 8
SYSTEM_LOCK_ERROR = 9
USER_INVALID = 10
OTHERS = 11
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " open_session
*& Form process_bdcdata
* BDCDATA
FORM process_bdcdata .
loop at i_vendor.
perform bdc_dynpro using 'SAPMF02K' '0107'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-KTOKK'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RF02K-LIFNR'
i_vendor-lifnr.
perform bdc_field using 'RF02K-EKORG'
i_vendor-ekorg.
perform bdc_field using 'RF02K-KTOKK'
i_vendor-ktokd.
perform bdc_dynpro using 'SAPMF02K' '0110'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-SPRAS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFA1-NAME1'
i_vendor-name1.
perform bdc_field using 'LFA1-SORTL'
i_vendor-sortl.
perform bdc_field using 'LFA1-LAND1'
i_vendor-land1.
perform bdc_field using 'LFA1-SPRAS'
i_vendor-spras.
perform bdc_dynpro using 'SAPMF02K' '0120'.
perform bdc_field using 'BDC_CURSOR'
'LFA1-KUNNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPMF02K' '0130'.
perform bdc_field using 'BDC_CURSOR'
'LFBK-BANKS(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPMF02K' '0310'.
perform bdc_field using 'BDC_CURSOR'
'LFM1-WAERS'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'LFM1-WAERS'
i_vendor-waers.
perform bdc_dynpro using 'SAPMF02K' '0320'.
perform bdc_field using 'BDC_CURSOR'
'RF02K-LIFNR'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
* Call the transaction code.
perform bdc_insert.
refresh i_bdcdata.
endloop.
ENDFORM. " process_bdcdata
*& Form bdc_dynpro
* text
* -->P_0264 text
* -->P_0265 text
FORM bdc_dynpro USING p_prog
p_scrn.
clear i_bdcdata.
i_bdcdata-program = p_prog.
i_bdcdata-dynpro = p_scrn.
i_bdcdata-dynbegin = 'X'.
append i_bdcdata.
ENDFORM. " bdc_dynpro
*& Form bdc_field
* text
FORM bdc_field USING p_fnam
p_fval.
clear i_bdcdata.
i_bdcdata-fnam = p_fnam.
i_bdcdata-fval = p_fval.
append i_bdcdata.
ENDFORM. " bdc_field
*& Form bdc_insert
* text
FORM bdc_insert .
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'MK01'
* POST_LOCAL = NOVBLOCAL
* PRINTING = NOPRINT
* SIMUBATCH = ' '
* CTUPARAMS = ' '
TABLES
DYNPROTAB = i_bdcdata
EXCEPTIONS
INTERNAL_ERROR = 1
NOT_OPEN = 2
QUEUE_ERROR = 3
TCODE_INVALID = 4
PRINTING_INVALID = 5
POSTING_INVALID = 6
OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " bdc_insert
*& Form close_group
* text
* --> p1 text
* <-- p2 text
FORM close_group .
CALL FUNCTION 'BDC_CLOSE_GROUP'
* EXCEPTIONS
* NOT_OPEN = 1
* QUEUE_ERROR = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " close_group
4) Save and activate.
5) Go to SM35 and see the session created. Vendor_MK01 (group name which was given)
6) Need to go to SM35. Select the Session name and Click on Process. Select BACKGROUND.
7) Click on PROCESSED Tab.
8) For seeing the log file select the session and click on LOG. Click on Display.
Difference between Call Transaction and Sessions Method.:
1) In CT if mode is ¡¥A¡¦ then there wont be log messages. In sessions method we can get log messages in Foreground and Background too.
2) In session method until and unless session Is created it wont update the data. But in CT data is updated immediately.
3) In CT for log messages have to write BDCMSGCOLL structure and Format_Messages function module. Logs are created automatically in Session method.
4) Data UPDATION in CT is Asynchronous. In Session method its Synchronous.
5) In CT we have to split the file. In Session method we need not split the file.
6) In CT we use BEND in Session we have to use END
Real time most of the times its SESSION Method.
Use CT method when:
a) Run time Validation. Example: We are creating a sales order. Here we are validating when selecting Payment Terms etc.
DIRECT INPUT Method:
If anything modified in SAP transaction don¡¦t use DI method. Updation is very fast.
There is no Restart mechanism in DI method.
Ex: have 10 records. 6,7 are error. In session method we needent go to the file. We have to go to BI and process again. Process in Foreground and during this time change at run time.
We need to go for the file. Delete the first files, last files and then upload the data and run again.
Main Transaction Code for DI is SXDB
1) Click on GoTo-----³ DX Tools
2) Object type---Select G/L Account ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
Q) How to copy files from SAP server to local?
Ans) Bcos we don¡¦t get authorization for AL11 transaction. If we know file directory and File name. We can see structure.
In SXDB.
1) Click on GoTo-----³ DX Tools
2) Object type---Select G/L Account (BUS 3006) ; Task type: Load Data; Program type: Batch Input; Program: RFBISA00 .
Go for Copy file. Give the Application Server file name and also he presentation server name and location.
*& Report ZBDC_MM01
REPORT ZBDC_MM01.
* Constants
constants : c_x type c value 'X'.
* Internal table for file
data : begin of i_text occurs 0,
text(255) type c,
end of i_text.
* iNTERNAL TABLE FOR MATERIAL LOAD
DATA : BEGIN OF I_MATERIAL OCCURS 0,
MATNR(18) TYPE C,
MBRSH(1) TYPE C,
MTART(4) TYPE C,
MAKTX(40) TYPE C,
MEINS(3) TYPE C,
MAKTL(3) TYPE C,
END OF I_MATERIAL.
* INTERNAL TABLE FOR BDCDATA
DATA I_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
* internal table for for logs
data i_bdcmsg like bdcmsgcoll occurs 0 with header line.
* Report id
data : v_repid like sy-repid,
v_msg(255) type c.
* Internal tabel for log records
data : begin of i_log occurs 0,
text(255) type c,
end of i_log.
* Selection-screen
selection-screen : begin of block blk with frame title text-001.
parameter p_file like rlgrap-filename.
selection-screen : end of block blk.
* fill the defaut value
INITIALIZATION.
v_repid = sy-repid.
* F4 value for File
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = v_repid
* DYNPRO_NUMBER = SYST-DYNNR
* FIELD_NAME = ' '
IMPORTING
FILE_NAME = p_file
start-of-selection.
* get the data from file to internal table
perform get_data_itab.
* tO PROCEESS BDCDATA
PERFORM PROCESS_BDCDATA.
end-of-selection.
* Process the data into file
perform download_file.
*& Form get_data_itab
* ws_upload
FORM get_data_itab .
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
FILENAME = P_FILE
FILETYPE = 'ASC'
* HEADLEN = ' '
* LINE_EXIT = ' '
* TRUNCLEN = ' '
* USER_FORM = ' '
* USER_PROG = ' '
* DAT_D_FORMAT = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = I_TEXT
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
LOOP AT I_TEXT.
SPLIT I_TEXT-TEXT AT ',' INTO I_MATERIAL-MATNR
I_MATERIAL-MBRSH
I_MATERIAL-MTART
I_MATERIAL-MAKTX
I_MATERIAL-MEINS
I_MATERIAL-MAKTL.
APPEND I_MATERIAL.
CLEAR : I_MATERIAL,
I_TEXT.
ENDLOOP.
ENDIF.
ENDFORM. " get_data_itab
*& Form PROCESS_BDCDATA
* bdcdata
FORM PROCESS_BDCDATA .
LOOP AT I_MATERIAL.
* First Screen
perform f_get_program using 'SAPLMGMM' '0060'.
perform f_get_field using 'BDC_CURSOR' 'RMMG1-MATNR'.
perform f_get_field using 'BDC_OKCODE' '=AUSW'.
perform f_get_field using 'RMMG1-MATNR' i_material-matnr.
perform f_get_field using 'RMMG1-MBRSH' i_material-mbrsh.
perform f_get_field using 'RMMG1-MTART' i_material-mtart.
* Second screen
perform f_get_program using 'SAPLMGMM' '0070'.
perform f_get_field using 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(01)'.
perform f_get_field using 'BDC_OKCODE' '=ENTR'.
perform f_get_field using 'MSICHTAUSW-KZSEL(01)' c_x.
* third screen
perform f_get_program using 'SAPLMGMM' '4004'.
perform f_get_field using 'BDC_CURSOR' 'MAKT-MAKTX'.
perform f_get_field using 'BDC_OKCODE' '=BU'.
perform f_get_field using 'MAKT-MAKTX' i_material-maktx.
perform f_get_field using 'MARA-MEINS' i_material-meins.
perform f_get_field using 'MARA-MATKL' i_material-maktl.
** call transaction
call transaction 'MM01'
using i_bdcdata
mode 'N'
messages into i_bdcmsg.
refresh i_bdcdata.
* Log message
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
ID = SY-MSGID
LANG = '-E'
NO = SY-MSGNO
V1 = SY-MSGV1
V2 = SY-MSGV2
V3 = SY-MSGV3
V4 = SY-MSGV4
IMPORTING
MSG = v_msg
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
i_log-text = v_msg.
append i_log.
clear: i_log,
v_msg.
ENDLOOP.
ENDFORM. " PROCESS_BDCDATA
*& Form f_get_program
* Program ,Screen no, Dynbegin
* -->P_0206 text
* -->P_0207 text
FORM f_get_program USING p_prog
p_scrn.
clear : i_bdcdata.
i_bdcdata-program = p_prog.
i_bdcdata-dynpro = p_scrn.
i_bdcdata-dynbegin = c_x.
append i_bdcdata.
ENDFORM. " f_get_program
*& Form f_get_field
* field name ,field value
* -->P_0217 text
* -->P_0218 text
FORM f_get_field USING p_fnam
p_fval.
clear i_bdcdata.
i_bdcdata-fnam = p_fnam.
i_bdcdata-fval = p_fval.
append i_bdcdata.
ENDFORM. " f_get_field
*& Form download_file
* text
* --> p1 text
* <-- p2 text
FORM download_file .
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
* BIN_FILESIZE = ' '
* CODEPAGE = ' '
FILENAME =
'C:Documents and SettingsAdministratorDesktoplog.txt'
FILETYPE = 'ASC'
* MODE = ' '
* WK1_N_FORMAT = ' '
* WK1_N_SIZE = ' '
* WK1_T_FORMAT = ' '
* WK1_T_SIZE = ' '
* COL_SELECT = ' '
* COL_SELECTMASK = ' '
* NO_AUTH_CHECK = ' '
* IMPORTING
* FILELENGTH =
TABLES
DATA_TAB = i_log
* FIELDNAMES =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_WRITE_ERROR = 2
INVALID_FILESIZE = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " download_file -
Problem in upload PDF file using Apache HttpClient3.1
Hi:
I am using Apache HttpClient 3.1 to upload pdf image from a STANDALONE java application to remote server (Weblogic9.1). Here are some questions:
1) Do i have to use multipartpost method? (I am uploading pdf image one by one)
2) The pdf image is added to request as:
HttpClient client = new HttpClient();
PostMethod method = new PostMethod("myServletUrl");
method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
new DefaultHttpMethodRetryHandler(3, false));
InputStreamRequestEntity entity = new InputStreamRequestEntity(new FileInputStream(file), "application/pdf");
method.setRequestEntity(entity);
method.setRequestHeader("Content-type", entity.getContentType());
int statusCode = client.executeMethod(method);
3) On server side, a servlet will save the posted pdf image as (Apache FileUpload is not used here):
InputStream is = req.getInputStream();
saveFile(is, fileName); // write this input stream to file.
The above steps 2 and 3 will create a pdf file on remote server with MUCH REDUCED size. Any idea what's the problem? content-type problem?
4) An working example link will be great.
thanksDunno, but as this is a client side issue, the solution, if there is one will lie in the HTML / javaScript.
If you dont get an answer in here, have google for an HTML solution, which you can then write out in your jsp. -
Problem in Uploading a File by Applet
Hi Members,
* I have faced problem while uploading a file from client to server by ftp protocol using APPLET(No JSP) only
* I am getting exception while running....
* My source code is as follows,
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class UploadAndDownload extends Applet implements ActionListener {
Button upload;
Button browse;
TextField filename;
File source = null;
Label name;
StringBuffer sb;
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
public void init() {
setLayout(new FlowLayout());
upload = new Button("Upload");
browse = new Button("Browse");
name = new Label("Filename");
filename = new TextField("", 45);
add(name);
add(filename);
add(upload);
add(browse);
upload.addActionListener(this);
browse.addActionListener(this);
public void actionPerformed(ActionEvent evt) {
// Code for browsing a file
String input_file_name = "";
if (evt.getSource() == browse)
Frame parent = new Frame();
FileDialog fd = new FileDialog(parent, "Select a file", FileDialog.LOAD);
fd.setVisible(true);
input_file_name = fd.getFile();
filename.setText(input_file_name);
// Gets the file from the file dialog and assign it to the source
source = new File(input_file_name);
repaint();
// Code for Uploading a file to the server
if (evt.getSource() == upload) {
// Appending the server pathname in string buffer
sb = new StringBuffer("ftp://");
sb.append("2847");
sb.append(':');
sb.append("Websphere25");
sb.append("@");
sb.append("172.16.1.111");
sb.append('/');
sb.append(input_file_name);
sb.append(";type=i");
try {
URL url = new URL(sb.toString());
URLConnection urlc = url.openConnection();
bos = new BufferedOutputStream(urlc.getOutputStream());
bis = new BufferedInputStream(new FileInputStream(source));
int i;
// Read from the inputstream and write it to the outputstream
while ((i = bis.read()) != -1) {
bos.write(i);
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (bis != null)
try {
bis.close();
} catch (IOException ioe) {
ioe.printStackTrace();
if (bos != null)
try {
bos.close();
} catch (IOException ioe) {
ioe.printStackTrace();
MY EXCEPTION IS,
Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.net.SocketPermission 172.16.1.111:80 connect,resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
at java.awt.Button.processActionEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know what problem in my code....
* Thanks in advance....* Thanks for your reply....
* I have signed my policy file by giving AllPermission and mentioned in java.security file in bin folder....
* My question is , by giving AllPermission , can we access and do all permissions like ( SecurityPermission, AWTPermission, SocketPermission, NetPermission, FilePermission, SecurityPermission etc )...
* My policy file is looks like follow,
/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
/* DO NOT EDIT */
grant {
permission java.security.AllPermission;
};* If i signed the policy like above, and when i run the applet file in InternetExplorer now , it thorws the following exception on my console,
java.net.ProtocolException: cannot write to a URLConnection if doOutput=false - call setDoOutput(true)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)
at sun.net.www.protocol.ftp.FtpURLConnection.getOutputStream(Unknown Source)
at UploadAndDownload.actionPerformed(UploadAndDownload.java:68)
at java.awt.Button.processActionEvent(Unknown Source)
at java.awt.Button.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)* Please let me know , how to solve this and give me your suggestion on the above process...
* Thanks in advance...
Regards,
JavaImran -
I am trying to upload a file using PRC, I am using .Net 2.0. Here is my code
IRemoteSession rSession = base.portletContext.GetRemotePortalSession();
IDocumentManager dManager = rSession.GetDocumentManager();
IRemoteDocument rDocument = dManager.CreateRemoteDocument(4079, 217, Server.MapPath("temp.txt"));
rDocument.SetType("http://www.plumtree.com/dtm/mime", "text/plain");
rDocument.SetOverrideName("Trying to upload");
rDocument.SetOverrideDescription("No Description");
int docID = -1;
try
docID = rDocument.Save();
catch (Exception ex)
Response.Write(ex);
Response.Write("<BR><BR>" + docID);
The code always falis with following errorPlumtree.Remote.PRC.PortalException: Exception of type 'Plumtree.Remote.PRC.PortalException' was thrown. ---> System.Web.Services.Protocols.SoapException: java.rmi.RemoteException: Error in function PTDataSource.ImportDocument (vDocumentLocationBagAsXML == '1001text/plainD:\Plumtree\RemotePortlets\FileContainer\temp.txt', lDocumentTypeID == 104, pCard == com.plumtree.server.impl.directory.PTCard@65e83f, bSummarize == false, pProvider == null): Error in function PTDataSource.ImportDocument (vDocumentLocationBagAsXML == text/plain1001D:\Plumtree\RemotePortlets\FileContainer\temp.txt, lDocumentTypeID == 104, pCard == com.plumtree.server.impl.directory.PTCard@65e83f, bSummarize == false, pProvider == null): Error in function SOAPEnvelope.Restore (arrayText == [B@7aa6f0): SOAP fault: faultcode='soapenv:Server.userException' faultstring='java.lang.NullPointerException' at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at com.plumtree.remote.prc.soap.DirectoryAPIService.submitRemoteDocumentMerge(String sLoginToken, Int32 nDataSourceID, Int32[] nFolderIDs, String sLocation, String sTypeID, String sTypeNameSpace, String sOverrideName, String sOverrideDesc, String sLanguage, Boolean bMergeACLs) at com.plumtree.remote.prc.soap.DirectoryProcedures.SubmitRemoteDocument(String sLoginToken, Int32 nDataSourceID, Int32[] nFolderIDs, String sLocation, String sTypeID, String sTypeNameSpace, String sOverrideName, String sOverrideDesc, String sLanguage, Boolean bMergeACLs) --- End of inner exception stack trace --- at Plumtree.Remote.PRC.DocumentWrapper.Save() at Gov.NSW.CCSU.Portal.FileContainer.FileBrowser.cmdUpload_Click(Object sender, EventArgs e) in D:\MyWorks\CCSU\Portal\ALUI\Portlets\FileContainer\FileContainer\FileBrowser.aspx.cs:line 48
I thought that there might be some problem in getting the file from the client,
so i used my own uploading routines for copying the
file in current App's directory,
even then i get the same error.
Any help is greatly appreciated!!!
Thanks,
Avi
[pre]Hello Dmitry,
Thanks a ton for your patience!
I have already tried step 1, still same error.
I have already tried step 2 and it works using Portal UI
Knowledge Directory-> Going to that specific folder - having ID 4079 -> selecting same file from same network share
Followed Step 3 and the result confirmed that I am using the correct DataSourceID
Here is the small piece of code
<Code>
IRemoteSession rSession = this.portletContext.GetRemotePortalSession();
IObjectManager oManager = rSession.GetObjectManager(ObjectClass.DataSource);
IObjectQuery oQuery = oManager.QueryObjects();
for (int i = 0; i < oQuery.GetRowCount(); i++)
Response.Write(oQuery.GetRow(i).GetName() + "-" + oQuery.GetRow(i).GetID() + "<BR>");
</Code>
Step 4 - We are not using ALI Content Service Windows File. Do you reckon I require this for Upload?
Step 5 – I ran PT Spy, reproduced the problem but couldn’t find any exception(On the portal server).
Let me give you a little insight of our dev environment here. Portal Server along with Remote Apps are installed on ServerX and Studio, Content Upload, Collaboration, Publisher are installed on ServerY. To neglect any permission issue I created the network share on ServerY as the Content Upload Service runs on Server Y.
Running PT Spy on other server (running Content Upload Service) showed few errors but I can not make much sense out of those.
What I can understand is
1. It makes the call to [submitRemoteDocumentMerge] with correct parameters.
<Parameter List>
nDataSourceID = 217
nFolderIDs = (1) { 4079 }
sLocation = \\ccsu-gmt-952.gnet.ccsu.nsw.gov.au\TempShare\temp.txt
sTypeID = text/plain
sTypeNameSpace = http://www.plumtree.com/dtm/mime
sOverrideName = Trying to upload
sOverrideDesc = No Description
sLanguage = (null)
bMergeACLs = false <ptLogMsgEnd>
</Parameter List>
2. But the call fails with following stack trace (copied partially)
<Stack Trace>
com.plumtree.server.impl.webservice.PTWebService SOAP call failed, an internal error occured on the remote server. Attempting to parse the SOAP fault for detailed error info. Web Service='File Upload Web Service', SOAP Action='urn:plumtree-com:DocumentProvider.AttachToDocument', URL='http://ServerY:11910/ptupload/services/DocumentProvider'
</Stack Trace>
3. Next line shows following Stack Trace
<Stack Trace>
com.plumtree.server.impl.soap.SOAPEnvelope Error in function SOAPEnvelope.Restore (arrayText == [B@7bd8a5): SOAP fault: faultcode='soapenv:Server.userException' faultstring='java.lang.NullPointerException'
com.plumtree.server.impl.soap.OpenSoapException: SOAP fault: faultcode='soapenv:Server.userException' faultstring='java.lang.NullPointerException'
</Stack Trace>
4. Then it starts giving the same error again.
5. I thought it might be expecting a value in Language Parameter, so I Passed US-en but still it screams.
I can send you the entire trace file if that helps.
Thanks a lot for helping so far, Plumtree is pretty new to me and I am finding it difficult to get my steps going.
Thanks,
Avi
Edited by asolvent at 03/24/2008 10:05 PM -
Multiple languges used while uploading a file using java appn
Hi everybody,
i have a problem with multiple languages , let me clear you the question, i were developing a java application using spring ,hibernate frame works, so i got a problem while uploading a file with chinees language or other
it was saving with different format other than chiness in the database, can any one help me out ... i need the exact language when i upload the files
thank you very muchSanthosh_25 wrote:
actually i have asked the users for the languages... they told some languages like chinees,japanese,german,french,koriean,spanish,italian,dutch,russsian,englishThat isn't deterministic.
Again, this is pointless unless it is deterministic.
But lets say that each language group only uses a single character set.
And each language group stores their files in a specific directory (or server).
That allows you to deterministically identify the character set of the file.
So you can then read each file by using a text reader from the java.io package with the correct encoding set.
This works because it is determinstic.
The following will NOT work.
You have a directory with a bunch of files with completely random content in different languages. There is NO way to write a program that will correctly handle those.
So, again, the first step before doing anything in java is figuring out how you will differentiate the different files. -
Problem with uploading a file in Clustered Environment
Hi,
I have a problem with uploading a file in a clustered environment. I have an iview component which facilitates an upload action of an xml config file. The problem is that the upload of the modified XML file is reflected only in the central instance of the cluster and not in the dialog instances. The dialog instances hold the old config file.
Is there any solution to upload the file to all the nodes in the cluster.
Thanks
KiranHi,
This is a known problem with clustered environment. Remember that your portal component runs on just on dialog instance and it doesn't automatically have access to the other nodes. However, there are some ways to get around this
1. Use KM to store files. KM is a common repository for all application servers and therefore you needn't worry more
2. Use an external batch oriented product (suresync/robocopy) to synch folders on the different DIs. You basically use your existing portal component, but there is a batch job which makes sure the upload folder is identical on all DIs (however, there is a slight delay depending on how often you run the batch job)
3. Store the files on a shared disk directly from the portal component.
Cheers
Dagfinn -
Uploading image file using tcode se78 occuring some Error
Hai Gurus
I am uploading image file using tcode se78 but while Uploading it giving some error i cant resolve the problem so any one help me plz
Error "Graphic LOGO could not be saved (2LOGO)"
Regards
SelvendranHai
Thanks
I had done in all method but i can't save it
error is coming ..so plz help me to upload the image
Error "Graphic LOGO could not be saved (2LOGO)"
Regards
Selvendran -
GUI_UPLOAD - Problem in uploading xml file
Hi,
I have problem in uploading xml file into itab.
Here is the code
begin of GS_STRING,
STR(72) type C,
end of GS_STRING,
GT_STRING like standard table of GS_STRING,
call function 'GUI_UPLOAD'
EXPORTING
FILENAME = FILE_NAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = GT_STRING
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
others = 17.
if SY-SUBRC <> 0.
message I499(SY) with 'File upload failed'.
stop.
endif.
endif.
In debuggin mode, i can see the itab uploaded with xml payload. But in that same place, the hexadecimal format has double zeros 00 after each character.
XML message : <?xml
Correct Hexadecimal : 3C3F786D6C
Hexadecimal in itab : 3C003F0078006D006C00
This makes the resultant xml invalid.
can anyone help me to solve this?
Thanks,
Uma
Edited by: Uma Maheswari on May 30, 2008 4:15 PMwhat do you want to do with the uploaded XML?
i use the following
constants: line_size type i value 255.
data: begin of xml_tab occurs 0,
raw(line_size) type x,
end of xml_tab,
file type string,
size type i.
call function 'GUI_UPLOAD'
exporting
filename = filename
filetype = 'BIN'
has_field_separator = ' '
header_length = 0
importing
filelength = size
tables
data_tab = xml_tab
exceptions
others = 1. -
Upload multiple file using csom
how to upload multiple files programmatically using csom and store in sharepoint list
BlitzHi,
I have seen a similar post from you, you want to upload multiple file using csom.
You can take a look at the following thread:
http://social.msdn.microsoft.com/Forums/en-US/edd3bd86-417b-4174-9627-5a714c733256/upload-multiple-files-using-client-context-object-model?forum=sharepointdevelopment
I would suggest you to open only single thread for single issue. You can discuss your problem in the above thread only.
Thank you for your understanding and support.
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support -
Hi All,
upload failed your changes were saved but could not be uploaded because of an error. you may be able to upload this file using server web page. save a copy button.
This is the issue which I am facing while working with SharePoint 2010. In a sharePoint 2010 document library I am having an excel file and I am trying to open it from Windows 7 and is office 2010.
I cam e across few suggestion as mentined below but unable to find the location where to do
Go to Resource Policies > Web >
Rewriting > Custom Headers > (if 'Custom Headers' is not visible, click
Customize on the right top to enable the view).
Create a new policy with the Resource as <fully qualified domain name of the SharePoint server:*/*> (for example https://sharepoint.juniper.net:*/* ).
Create the action as Allow Custom Headers.
Apply the settings to the required roles.
Please suggest.Hi rkarteek
All things you have to do is as follows:
1. Open regedit.exe
2. Naviagate to following key:
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\14.0\Common\Internet]
3. Click Edit Menu -> New -> DWORD with name of "FSSHTTPOff"
(without quotes)
4. Click on "FSSHTTPOff" and enter value of 1
5.
Close any Office Applications and browser sessions
6. Try to reopen your document (no more read only or failure to upload)
have a nice day! -
How to upload multiple files using af:inputfile
Hi,
I am using J dev 11.1.1.3. I have a requirement wherein i need to upload multiple files using af:inputfile. Can we do in it ADF ? Is there any other work around to implement the same. I have checked previous questions but not able to find proper solution for this.
Any pointer in this regard is highly helpful.
Regards,
KalyanYou have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
1) allow the user to select multiple filenames (somehow)
2) zip them together
3) upload the zip
4) unpack the zip on the server
5) work with the files
Timo -
How to upload multiple files using wicket
Hai,
how to upload multiple files using wicket at a single browse.
any suggestion?
Thanks in advanceYou have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
1) allow the user to select multiple filenames (somehow)
2) zip them together
3) upload the zip
4) unpack the zip on the server
5) work with the files
Timo -
How to Upload a File using FileReference + PHP??
How to Upload a File using FileReference + PHP??
If you could help me with a two code examples the AS code and
the PHP code of a working example.
Thanks
Jorgehttp://www.flash-db.com/Tutorials/upload/upFiles.php?page=1
Maybe you are looking for
-
Just dropped my computer and no longer see airport
My PowerPC Powerbook 15" G4 just hit the floor, and afterwards my Airport no longer shows up on the computer. When I run a system profile, no info is found. I ran Disk Warrior and re-built the directory, but no good. I wonder if the fall just dislodg
-
Want to see combination of Purchase Order and A/P report at material level
Hello, Anyone familiar with an InfoProvider that will show a combination of Purchase Order and A/P data combined? I'm specifically looking for a source that includes the PO information at the <b>Vendor / Material</b> level with order value and quanti
-
Java Web Start no longer works after Update 4
After applying the update to Java for Mac OS X 10.5 Update 4, my webstart files (.jnlp) now all think they are Internet Explorer files to be opened in Parallels. Does anyone know how to re-associate these files with Java? Or, otherwise, a workaround
-
Combination of 2 fields for an output
I have this 2 fields SBSNBR, SEQNBR and I need to combine them into a 50 character length . The total records of the two fields will be 11 in total and I want the remaining to populated with zeroes. Blow is an example of expected output: characters
-
Steps for building SCOM infrastructure in Windows Azure for monitoring on-premise services ?
Is there a good technical document which clearly detail the steps required to build a SCOM management group in Windows Azure ? I will be using it to monitoring on premise services. I want the entire management group in Azure with SCOM gateways at t