How to upload excel fiel with 'FileUpload' UI element ?
Hi,
my customer donot want to upload excel in CSV format. And how could i convert excel file into my internal table?
BR.
For converting excel file to internal table you can use the fm GUI_DOWNLOAD.
Also refer to the below post. It may be helpful to you. Thanks.
[Conversion of internal table into excel file format &put it on app server;
Similar Messages
-
How to upload Excel data in Ztables fastly & easily.
Dear ALL,
I want to compare material codes in 2 different excel sheets.
I have downloaded output from 2 different SQVI into 2 different excel sheets.
Now I want to compare these 2 sheets to get matching codes or unmatching codes.
I can use VLOOKUP in excel also. But How can I make use of ABAP by downloading these excel data in 2 different Ztables and compare these 2 tables with some user defined TC (transaction code) ?
For this activity How to upload Excel data(2 sheets) in 2 Ztables fastly & easily ?
Is there any method other than SCAT , BDC and LSMW ???
Or which is best method in above ?
Pl' reply.
Thanks.Have a look at the program
*: Description :
*: This is a simple example program to get data from an excel :
*: file and store it in an internal table. :
*: Author : www.sapdev.co.uk, based on code from Jayanta :
*: SAP Version : 4.7 :
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 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.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
Message was edited by:
K N REDDY -
How to upload Excel file in BI using function module in abap program
How to upload Excel file in BI using function module in abap program?
Hi Anuj,
To upload the file , you can try a standard program "RSEPSFTP" .
while you execute the program , a selection screen appears in which the inputs should be give as
RFC destination - The target server name
FTP command- PUT
local file - your file name
local directory - path of your local file
remote file - your target file name
remote directory - where it has to be stored
Hope this is useful for you
Thanks & regards
Anju -
How to upload excel file in application server??
Hi,
How to upload an excel file into internal table in background mode from application server?
ThanksHi vipin,
check this it may help you...
hope below links helps you
Export the report list to Excel Sheet
http://www.sapdevelopment.co.uk/file/file_updown.htm
or below is a sample programme which helps you upload and download
REPORT ytest5 LINE-SIZE 80
LINE-COUNT 65
NO STANDARD PAGE HEADING.
TABLES: dd02l, dd03l.
* selection screen
SELECTION-SCREEN BEGIN OF BLOCK b00 WITH FRAME TITLE text-b00.
SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
PARAMETERS: tabname LIKE dd02l-tabname OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b01.
SELECTION-SCREEN BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
PARAMETERS: path(30) TYPE c DEFAULT 'C:SAPWorkdir'.
SELECTION-SCREEN END OF BLOCK b03.
SELECTION-SCREEN BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
PARAMETERS: p_exp RADIOBUTTON GROUP radi,
p_imp RADIOBUTTON GROUP radi,
p_clear AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b04.
SELECTION-SCREEN END OF BLOCK b00.
* data
DATA: q_return LIKE syst-subrc,
err_flag(1) TYPE c,
answer(1) TYPE c,
w_text1(62) TYPE c,
w_text2(40) TYPE c,
winfile(128) TYPE c,
w_system(40) TYPE c,
winsys(7) TYPE c,
zname(8) TYPE c,
w_line(80) TYPE c.
* internal tables
DATA : BEGIN OF textpool_tab OCCURS 0.
INCLUDE STRUCTURE textpool.
DATA : END OF textpool_tab.
* table for subroutine pool
DATA : itab(80) OCCURS 0.
* events
INITIALIZATION.
PERFORM check_system.
AT SELECTION-SCREEN ON tabname.
PERFORM check_table_exists.
START-OF-SELECTION.
PERFORM init_report_texts.
PERFORM request_confirmation.
END-OF-SELECTION.
IF answer = 'J'.
PERFORM execute_program_function.
ENDIF.
TOP-OF-PAGE.
PERFORM process_top_of_page.
* forms
* FORM CHECK_TABLE_EXISTS *
FORM check_table_exists.
SELECT SINGLE * FROM dd02l
INTO CORRESPONDING FIELDS OF dd02l
WHERE tabname = tabname.
CHECK syst-subrc NE 0.
MESSAGE e402(mo) WITH tabname.
ENDFORM.
* FORM INIT_REPORT_TEXTS *
FORM init_report_texts.
READ TEXTPOOL syst-repid
INTO textpool_tab LANGUAGE syst-langu.
LOOP AT textpool_tab
WHERE id EQ 'R' OR id EQ 'T'.
REPLACE '&1............................'
WITH tabname INTO textpool_tab-entry.
MODIFY textpool_tab.
ENDLOOP.
ENDFORM.
* FORM REQUEST_CONFIRMATION *
FORM request_confirmation.
* import selected, confirm action
IF p_imp = 'X'.
* build message text for popup
CONCATENATE 'Data for table'
tabname
'will be imported' INTO w_text1 SEPARATED BY space.
* check if delete existing selected, and change message text
IF p_clear = ' '.
w_text2 = 'and appended to the end of existing data'.
ELSE.
w_text2 = 'Existing Data will be deleted'.
ENDIF.
CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
EXPORTING
defaultoption = 'N'
textline1 = w_text1
textline2 = w_text2
titel = 'Confirm Import of Data'
cancel_display = ' '
IMPORTING
answer = answer
EXCEPTIONS
OTHERS = 1.
ELSE.
* export selected, set answer to yes so export can continue
answer = 'J'.
ENDIF.
ENDFORM.
* FORM EXECUTE_PROGRAM_FUNCTION *
FORM execute_program_function.
PERFORM build_file_name.
CLEAR: q_return,err_flag.
IF p_imp = 'X'.
PERFORM check_file_exists.
CHECK err_flag = ' '.
PERFORM func_import.
ELSE.
PERFORM func_export.
ENDIF.
ENDFORM.
* FORM BUILD_FILE_NAME *
FORM build_file_name.
MOVE path TO winfile.
WRITE '' TO winfile+30.
WRITE tabname TO winfile+31.
WRITE '.TAB' TO winfile+61(4).
CONDENSE winfile NO-GAPS.
ENDFORM.
* FORM CHECK_FILE_EXISTS *
FORM check_file_exists.
CALL FUNCTION 'WS_QUERY'
EXPORTING
filename = winfile
query = 'FE'
IMPORTING
return = q_return
EXCEPTIONS
OTHERS = 1.
IF syst-subrc NE 0 OR q_return NE 1.
err_flag = 'X'.
ENDIF.
ENDFORM.
* FORM func_export *
FORM func_export.
CLEAR itab. REFRESH itab.
APPEND 'PROGRAM SUBPOOL.' TO itab.
APPEND 'FORM DOWNLOAD.' TO itab.
APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
CONCATENATE 'INCLUDE STRUCTURE'
tabname
'.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'DATA: END OF IT_TAB.' TO itab.
CONCATENATE 'SELECT * FROM'
tabname
'INTO TABLE IT_TAB.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'CALL FUNCTION ''WS_DOWNLOAD''' TO itab.
APPEND 'EXPORTING' TO itab.
CONCATENATE 'filename = ' ''''
winfile '''' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'filetype = ''DAT''' TO itab.
APPEND 'TABLES' TO itab.
APPEND 'DATA_TAB = IT_TAB.' TO itab.
APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.
APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
APPEND 'WRITE: /1 syst-vline,' TO itab.
APPEND '''EXPORT'',' TO itab.
APPEND '15 ''data line(s) have been exported'',' TO itab.
APPEND '68 syst-index,' TO itab.
APPEND '80 syst-vline.' TO itab.
APPEND 'ULINE.' TO itab.
APPEND 'ENDFORM.' TO itab.
GENERATE SUBROUTINE POOL itab NAME zname.
PERFORM download IN PROGRAM (zname).
ENDFORM.
* FORM func_import *
FORM func_import.
CLEAR itab. REFRESH itab.
APPEND 'PROGRAM SUBPOOL.' TO itab.
APPEND 'FORM UPLOAD.' TO itab.
APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
CONCATENATE 'INCLUDE STRUCTURE'
tabname
'.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'DATA: END OF IT_TAB.' TO itab.
APPEND 'DATA: BEGIN OF IT_TAB2 OCCURS 0.' TO itab.
CONCATENATE 'INCLUDE STRUCTURE'
tabname
'.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'DATA: END OF IT_TAB2.' TO itab.
APPEND 'CALL FUNCTION ''WS_UPLOAD''' TO itab.
APPEND 'EXPORTING' TO itab.
CONCATENATE 'filename = ' ''''
winfile '''' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'filetype = ''DAT''' TO itab.
APPEND 'TABLES' TO itab.
APPEND 'DATA_TAB = IT_TAB.' TO itab.
IF p_clear = 'X'.
CONCATENATE 'SELECT * FROM'
tabname
'INTO TABLE IT_TAB2.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'LOOP AT IT_TAB2.' TO itab.
CONCATENATE 'DELETE'
tabname
'FROM IT_TAB2.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'ENDLOOP.' TO itab.
APPEND 'COMMIT WORK.' TO itab.
ENDIF.
APPEND 'LOOP AT IT_TAB.' TO itab.
CONCATENATE 'MODIFY'
tabname
'FROM IT_TAB.' INTO w_line SEPARATED BY space.
APPEND w_line TO itab.
APPEND 'ENDLOOP.' TO itab.
APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.
APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
APPEND 'WRITE: /1 syst-vline,' TO itab.
APPEND '''IMPORT'',' TO itab.
APPEND '15 ''data line(s) have been imported'',' TO itab.
APPEND '68 syst-index,' TO itab.
APPEND '80 syst-vline.' TO itab.
APPEND 'ULINE.' TO itab.
APPEND 'ENDFORM.' TO itab.
GENERATE SUBROUTINE POOL itab NAME zname.
PERFORM upload IN PROGRAM (zname).
ENDFORM.
* Form CHECK_SYSTEM
* Check users workstation is running
* WINDOWS 95, or WINDOWS NT.
* OS/2 uses 8.3 file names which are no good for
* this application as filenames created are 30 char
* same as table name.
* You could change the logic to only use the first 8 chars
* of the table name for the filename, but you could possibly
* get problems if users had exported already with a table
* with the same first 8 chars.
* As an alternate method you could request the user to input
* the full path including filename and remove the logic to
* build the path using the table name.
FORM check_system.
CALL FUNCTION 'WS_QUERY'
EXPORTING
query = 'WS'
IMPORTING
return = winsys.
IF winsys NE 'WN32_95'.
WRITE: 'Windows NT or Windows 95/98 is required'.
EXIT.
ENDIF.
ENDFORM. " CHECK_SYSTEM
* FORM PROCESS_TOP_OF_PAGE *
FORM process_top_of_page.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
ULINE.
CONCATENATE syst-sysid
syst-saprl
syst-host INTO w_system SEPARATED BY space.
WRITE : AT /1(syst-linsz) w_system CENTERED.
WRITE : AT 1 syst-vline, syst-uname.
syst-linsz = syst-linsz - 11.
WRITE : AT syst-linsz syst-repid(008).
syst-linsz = syst-linsz + 11.
WRITE : AT syst-linsz syst-vline.
LOOP AT textpool_tab WHERE id EQ 'R'.
WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
ENDLOOP.
WRITE : AT 1 syst-vline, syst-datum.
syst-linsz = syst-linsz - 11.
WRITE : AT syst-linsz syst-tcode(004).
syst-linsz = syst-linsz + 11.
WRITE : AT syst-linsz syst-vline.
LOOP AT textpool_tab WHERE id EQ 'T'.
WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
ENDLOOP.
WRITE : AT 1 syst-vline, syst-uzeit.
syst-linsz = syst-linsz - 11.
WRITE : AT syst-linsz 'Page', syst-pagno.
syst-linsz = syst-linsz + 11.
WRITE : AT syst-linsz syst-vline.
ULINE.
FORMAT COLOR COL_HEADING INTENSIFIED OFF.
LOOP AT textpool_tab WHERE id EQ 'H'.
WRITE : AT /1(syst-linsz) textpool_tab-entry.
ENDLOOP.
ULINE.
ENDFORM.
if it helps you reward with points.
regards,
venu
regards,
venu. -
How to upload excel file in Webdynpro application using ABAP
Hi Experts,
Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.
get single attribute
wd_context->get_attribute(
EXPORTING
name = `DATASOURCE`
IMPORTING
value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
Bind With table Element.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
fs_table-age = lv_field.
APPEND fs_table TO t_table1.
ENDLOOP.
lo_nd_data = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_data->bind_table( T_TABLE1 ).
Thanks,
SubathraDear Exports
Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.
Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem.
Regards
Rashmita -
How To Upload Object Dependency with Long Source Code
Hi Everyone,
I use LSMW (IDoc:KNOMAS) to upload the Object Dependency with T-Code CU01. However I can not upload the formula/source code within more than 72 characters due to the maximum size of the source code field in dependency editor is 72 characters.
Is there anyone that have the same problem and know the solution? Or is there any advice / tips how to upload the Object Dependency that have long source code?
Any comments is appreciated. Thank you before hand.Hi Mika Permana,
Same Problem am also getting when i was trying to upload more than one object dependency syntax's on CU01,
After that i came to know we can restrict that all those things before 72 character's and we can add all those things to the next line in notepad,
For Example,
Header 1
$SELF.Z_PRICE_HDC= 'HDC30' IF TURNAROUND = 'TAT5' AND NDF_COLOR1 = '4/4'
AND NDF_COLOR1 = '4/4'
Here We cant upload the object dependencies through to excel file,because KCD_EXCEL_OLE_TO_INT_CONVERT and ALSMEX_TABLINE function module having 'Value' field ,its length is 50 only,
so it cant allow after 50th word. so i preferred to use notepad!!!
the following code is for your reference.
LOOP AT i_index WHERE knnam_001 = it_mmtab-knnam_001.
l_count = l_count + 1.
CONCATENATE 'RSTXP-TDLINE(' l_count ')' INTO var1.
PERFORM bdc_field USING var1 " 'RSTXP-TDLINE(01)' " syntax
i_index-tdline_01_006.
IF l_count > 15.
MESSAGE 'LINE ITEM EXCEEDED > 15 ' TYPE 'E'.
ENDIF.
ENDLOOP.
Thanks & Regards,BASTIN VINOTH NGSAP Technical Consultant, Unisoft Infotech Pvt. Ltd., -
Error message while upload excel file (with macro) to sap (iw28)
While upload excel file to sap through iw28, i get error message (vb)
u2022 i have to say that the excel file contain macro , with out the macro , work fine .
u2022 The error display just in refresh command.
the error message :
Public Sub ALV_CUS_Exit()
Dim objs As ChartObjects
Dim obj As ChartObject
Dim sheet As Worksheet
Dim r As Range
For Each sheet In Sheets
Set objs = sheet.ChartObjects
For Each obj In objs
Set r = Sheets("RawData").UsedRange
obj.Chart.SetSourceData Source:=r
Next obj
Next sheet
End Subhi,
This is releated to the ABAP coding...There might be some ouput problem in the Abap list viewer...Pls check it with the ABAP consultant...
Regards
Priyanka.P -
Hi,
Problem Description: Need to upload a document with values related to document properties using custom form in to document set using JavaScript Object Model.
Kindly let me know any solutions.
Thanks
Razvi444The following code shows how to use REST/Ajax to upload a document to a document set.
function uploadToDocumentSet(filename, content) {
appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
var restSource = appweburl +
"/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/add(url='" + filename + "',overwrite=true)?@target='" + hostweburl + "'";
var dfd = $.Deferred();
$.ajax(
'url': restSource,
'method': 'POST',
'data': content,
processData: false,
timeout:1000000,
'headers': {
'accept': 'application/json;odata=verbose',
'X-RequestDigest': $('#__REQUESTDIGEST').val(),
"content-length": content.byteLength
'success': function (data) {
var d = data;
dfd.resolve(d);
'error': function (err,textStatus,errorThrown) {
dfd.reject(err);
return dfd;
Then when this code returns you can use the following to update the metadata of the new document.
function updateMetadataNoVersion(fileUrl) {
appweburl = decodeURIComponent(getQueryStringParameter('SPAppWebUrl'));
hostweburl = decodeURIComponent(getQueryStringParameter('SPHostUrl'));
var restSource = appweburl +
"/_api/SP.AppContextSite(@target)/web/GetFolderByServerRelativeUrl('/restdocuments/testds')/files/getbyurl(url='" + fileUrl + "')/listitemallfields/validateupdatelistitem?@target='" + hostweburl + "'";
var dfd = $.Deferred();
$.ajax(
'url': restSource,
'method': 'POST',
'data': JSON.stringify({
'formValues': [
'__metadata': { 'type': 'SP.ListItemFormUpdateValue' },
'FieldName': 'Title',
'FieldValue': 'My Title2'
'bNewDocumentUpdate': true,
'checkInComment': ''
'headers': {
'accept': 'application/json;odata=verbose',
'content-type': 'application/json;odata=verbose',
'X-RequestDigest': $('#__REQUESTDIGEST').val()
'success': function (data) {
var d = data;
dfd.resolve(d);
'error': function (err) {
dfd.reject(err);
return dfd;
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer -
How to upload large file with http via post
Hi guys,
Does anybody know how to upload large file (>100 MB) use applet to servlet with http via post method? Thanks in advance.
Regards,
Mark.Hi SuckRatE
Thanks for your reply. Could you give me some client side code to upload a large file. I use URL to connect to server. It throws out of memory exception. The part of client code is below:
// connect to the servlet
URL theServlet = new URL(servletLocation);
URLConnection servletConnection = theServlet.openConnection();
// inform the connection that we will send output and accept input
servletConnection.setDoInput(true);
servletConnection.setDoOutput(true);
// Don't used a cached version of URL connection.
servletConnection.setUseCaches (false);
servletConnection.setDefaultUseCaches(false);
// Specify the content type that we will send text data
servletConnection.setRequestProperty("Content-Type",
+"application/octet-stream");
// send the user string to the servlet.
OutputStream outStream = servletConnection.getOutputStream();
FileInputStream filein = new FileInputStream(largeFile);
//BufferedReader in = new BufferedReader(new InputStreamReader
+(servletConnection.getInputStream()));
//System.out.println("tempCurrent = "+in.readLine());
byte abyte[] = new byte[2048];
int cnt = 0;
while((cnt = filein.read(abyte)) > 0)
outStream.write(abyte, 0, cnt);
filein.close();
outStream.flush();
outStream.close();
Regards,
Mark. -
How to upload a file with a HTML form into a BLOB ?
Hi,
I want to upload a file into a BLOB.
I have created a procedure in PL/SQL whitch generates an html form.
You can upload a file with <input type="file" name="my_file">.
How can I insert this file into my database ?
Thank's for your Help
EstelleHi Estelle,
Portal Applications forum is a more apporpriate forum for such questions. Please post your question there.
Thanks,
Ravi -
How to upload an Hompage with iWeb with other website nam
I'm an Amateur in this and wanted to ask how can I upload a Website with iWeb or other Programm with an other Address
ThanksActually, forwarding has nothing to do with name servers. You should not need to alter these at all.
Did you fill in your personal domain in your MMe account to use the CNAME forwarding option? If so, then at your host you should have gone and altered the DNS settings. You need to enter something similar to www, then select the CNAME option from a drop down menu and then forward to web.me.com.
If you are not using the CNAME option, then you can use ordinary web forwarding which entails going to web forwarding and forwarding your domain to web.me.com/username/sitename.
Name Server settings should not enter into any of this, it should just be either your DNS settings or web forwarding.
So, if you entered your personal domain name into your MMe account and forwarded to web.me.com, then somewhere along the line, you should have entered and set up CNAME in your DNS settings.
If you did not do this, then I believe that the "Kind folk at the Apple store" have given you incorrect information. -
How to upload image along with timestamp
Hi all,
I need to upload an image (byte array) and its timestamp to server which has jsp/servlet. But having trouble to transmit both in the same request.
In actionscript, I use URLRequest and URLLoader and upload the image without problem, however, I don't know how to upload the timestamp in the same request. I tried to build a ByteArray to contain both timestamp and the image, but I couldn't convert the Date.getTime() to byte[] correctly. The only function in ByteArray to input 8 bytes is writeDouble, but it doesn't embed the time correctly.
Where is the best way to handle this?
Thanks a lotThanks for the reply.
Can you shed some light how to transfer the file over? I use URLLoader with POST method and set the request data to a bytearray which is the image bitmapdata bit array. How do I send the the file name over? (parse the filename is not a problem)
Thanks,
Rovi -
How to Upload Excel sheet in DB or internal table using SAP NetWeaver ABAP
Dear All experts,
Pls provide guidance to Upload Excel sheet in DB or internal table using ABAP in ( SAP NetWeaver stack )
Regards
Machindra
Edited by: Machindra Patade on Apr 8, 2010 3:07 PMPlease search before posting.
Thread locked.
Thomas -
Upload / Save file via FileUpload UI Element under predefined path
Hi,
I am pretty new to this topic and need some help.
I need a Web Dynpro App where I can select a file via FileUpload UI Element and save this file to a predefined path e.g. to a server. I already found [this help|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00062266-3aa9-2910-d485-f1088c3a4d71?quicklink=index&overridelayout=true] but in this example the file is stored at the SAP Server!
How can I achieve this? May you give me a sample code?
I appreciate your help.
RegardsHi Martni, Above answer was incomplete
try{
File fp = new File(relativePath+ fileName);
fp.createNewFile();
FileOutputStream fos = new FileOutputStream(fp);
BufferedOutputStream bos = new BufferedOutputStream(fos);
InputStream l_is_FileStream = elAttachmentsElement.getVa_Resource().read(false);
int l_int_NoOfBytes = l_is_FileStream.available();
byte[] byteArray = new byte[l_int_NoOfBytes];
l_is_FileStream.read(byteArray, 0, l_int_NoOfBytes);
bos.write(byteArray);
bos.flush();
catch (Exception e) {
wdComponentAPI.getMessageManager().reportException("Cannot save the file: "+fileName);
In the above snippet "relativePath" is the path to the folder in WAS and "filename" is the name of the file along with its extn Ex. test.doc, or image.jpg
InputStream l_is_FileStream = elAttachmentsElement.getVa_Resource().read(false)
The above line of code is the sixth line in the snippet and here "elAttachmentsElement" is the element of the node having "Va_Resource" context attribute, which is bound to FileUpload UI element.
Regards,
Vishweshwara P.K.M
Edited by: Vishweshwara P.K.M on Jun 28, 2010 1:31 PM -
How to limit file size for FileUpload UI element?
Hi all,
I'm using the FileUpload UI element in NW2004s SP20.
I want to limit the size of the uploaded file.
The simple option is to load the file to the context, check the size, by using
InputStream stream = resource.read(false);
double size = stream.available();
and report errors if any.
However, I don't want to store huge files in the context or flie system (even temporarily) nor 'spend' network resources for uploading a file that I won't be use...
Is there a way to limit the file size by using some property for the fileUpload UI element in the server?
Is there a way to check the file size before it's uploaded (for example like GMAIL does - checks the file BEFORE the actual upload)
Regards,
OmriHi Omri,
"(but this can be checked AFTER the file was uploaded)" - what do you really mean here? I mean your main query is to restrict the file upload if it crosses certain size-limit. What is the use if you check the size after upload?
My problem is the network traffic and the CPU load if users are trying to download huge files..., if the upload is restricted for size this download problem will not come .. correct?
Not sure about the UI element properties has something to restrict the size, and if its really related to Network traffic and CPU utilization, i think you've to check with Basis team to re-sizing the servers to meet this new requirement of upload/download if its not considered before.
Or the last option i could see is to use KM Upload iView if sizing is done with these considerations.
Thanks,
MS
Maybe you are looking for
-
Is there anything that might possibly be done to try and fix this? I have only had my touch for about 10 months. It was working fine and when I was using it to take photos it said low battery,I hit ignore took a few more pix then put it away.When I g
-
Embedded Video Plays on PCs but Not Macs
As the King of Siam declared, "It's a puzzlement." I'm updating a site and have embedded a .mov from the client's YouTube channel using YouTube's preferred <iframe> code. Here is the URL: http://www.realcosmetics.com/ourStory.html. The video will pla
-
Hi ,this may be simple but always gets som problem while trying in f-53, outgoing payment with clearing. process, already i have posted one document in f-43 for 500000, now for 5000 in f-53 . .what is my error . what should i do for clearing this err
-
Hi Gurus, I am getting an error while transporting. The Error was Extract structure XXXXX is not active. The extract structure XXXXXof the DataSource XXXXX is invalid and Field XXXXX will not be delivered from DataSource XXXXX in source system Produc
-
Speeding Up The Loading Time of Plug-Ins.....
Hi. I have Scarbee Vintage Keyboard Collection and it takes about 1/2 mins to load the engine, then 2/3 mins to load a patch. It doesnt do this with other plugins and my computer is certainly not slow. Has anyone got any ideas of what this could be?