How to upload and resume upload over webservice !!!
Hello everybody ! I have two problems:
Content:"I want to have the functions (upload and resume) . I write javaDesktopApplication and call these functions over webservice.
Please give me your ideas and help me!!!
I thank so much!
I have just wirtten some code:
Every body read and give me idea.
+ On client:
int chunk =1024;
byte[] Buffer = new byte[chunk];
String filePath = jTextField1.getText();
File file1= new File(filePath);
FileInputStream is = new FileInputStream(file1);
try { // Call Web Service Operation
org.fos.WSfosService service = new org.fos.WSfosService();
org.fos.WSfos port = service.getWSfosPort();
port.http(Buffer , jLabel2.getText(), is);
System.out.println("Result = "+result);
} catch (Exception ex) {
// TODO handle custom exceptions here
+ On server:
@WebMethod()
public void http(byte[] Buffer, String FileName, FileInputStream is)
String pathUp ="D:"+ File.separator + "upload" File.separator FileName;
try
FileOutPutStream os = new FileOutputStream(pathUp);
int readBytes;
while( (readBytes =is.read(Buffer)) != -1)
os.write(Buffer,0,readBytes);
is.close();
os.close();
catch(Exception ex)
System.out.println( ex );
}
Similar Messages
-
How to hide and resume a native activity in flex app
what i want to do is like this:
(1)start an activity by the native extension when lauching the application and then display a list for users to choose
(2)make a choice and send it back to the flex
(3)flex does something and then jump to the native list above for users to choose
the problem is:
how to hide the native activity in step(1) and how to resume it in step(3)?
as the download of the native list wastes much time, i dont want to destroy the native activity and recreate it.
can anybody help? i will be thankful!You probably know by now but I though maybe a could actualy
answer someone question.
{Application.application.parameters.name)
put that in mx:text and you can see the var "name" -
How to stop and resume smart card reader handle using OCF framework
I need to stop the reader handle and transfer the handle to other application and after reply from that application, i have to resume the reader handle.
I tried Smartcard.shutdown and then I used SmartCard.start but it doesnt help.
Can anyone help me to sort out this issue?
Provide some sample code if possible.
Thanking you in advance.with ocf you have CardTerminal instances to represent readers.
Did you try the close() method on your CardTerminal instance?
afterwards, you can open() it. -
How to stop and resume a subVI from the main VI?
I am trying to write a test sequencer, I need to start a subVI (which is a test sequence) from my main VI, I'd like to control the execution of subVI by pressing the 'stop' 'resume' 'jump step' button in the main VI. Does anyone have any idea how to implement this in LV?
Thank you.Yay for State Machine!! I would actually recommend the State Machine Using Events design pattern. Taking advantage of the Event Structure will allow you to replace the "Idle" state in the traditional state diagram design pattern. Instead, we are not waking LabVIEW to handle particular events on the front panel.
More information regarding the State Machine design pattern as well as design patterns in general are available:
NIDZ Tutorial: Changing the Face of Design Patterns with LabVIEW 7 Express Event Structure
NIDZ Tutorial: Applicati
on Design Patterns: State Machines
LabVIEW Application Design Patterns
Good luck. -
How to stop and resume the animations of nested movieclips
Hi
I have many nested movieclips in different positions of the main timeline.
I have 2 buttons, play_btn and pause_btn.
I'd like when the user click pause_btn, the animations on the main timeline and in nested movieclips stop.
Whe he click play_btn the animations resume in both the main timeline and nested movieclips.
I have created array of nested movieclips on the main timeline.
var arr:Array = new Array(mc1, mc2, mc3, mc4, mc5);
play_btn.addEventListener(MouseEvent.CLICK, on_play_btn);
pause_btn.addEventListener(MouseEvent.CLICK, on_pause_btn);
function on_play_btn(e:MouseEvent):void
gotoAndPlay(currentFrame);
for(var i:Number = 0; i < arr.length; i++)
if(arr[i] != null)
arr[i].play();
function on_pause_btn(e:MouseEvent):void
gotoAndStop(currentFrame);
for(var k:Number = 0; k < arr.length; k++)
if(arr[k] != null)
arr[k].stop();
but it only stops the animations on the main timeline and dosen't stop the animations in the nested movieclips.
Help me Please.I'm having the same issue.I have a main timeline, which has nested movieclips with there own timelines and motion tweens. Using the new motion tween, and not the classic tween, which may or may not be the problem.
Was having a similar issue with stopping the timeline, the main timeline would stop, but the nested movieclips would keep going. Found this blog post that helped.
http://blog.nobien.net/2009/02/05/as3-stopping-all-timeline-animations/
Used the code below to stop everything by passing the stage as the displayObject. Worked great, but now i'm having the reverse issue. When I resume play, the nested movieclip timeline stays exactly where I stopped it, and the main timeline resumes play. If there are a 100 frames in the nested movieclip, once it reaches the 101st frame, the main timeline kicks in again.
function stopAllChildMovieClips(displayObject:DisplayObjectContainer):void{
var numChildren:int = displayObject.numChildren;
for (var i:int = 0; i < numChildren; i++) {
var child:DisplayObject = displayObject.getChildAt(i);
if (child is DisplayObjectContainer) {
if (child is MovieClip) {
MovieClip(child).stop();
stopAllChildMovieClips(DisplayObjectContainer(child)); -
I am going to buy a Mac desktop and want to know how to transfer all my purchases and uploaded music from my PC. I originally started using iTunes on my PC so it has everything I have ever purchased or uploaded from my own collection of music.
How can I do this to ensure all videos and music transfer over and not just purchases? Do they do it at the Apple Store or at Best Buy? help!Move iTunes Library from PC to MAC
http://www.macworld.com/article/146958/2010/03/move_itunes_windows_mac.html
Also, See here if you need to... iTunes to an External Drive
http://support.apple.com/kb/HT1751 -
How can applicants upload their cover letter and resume to us?
We are using FormsCentral to manage our forms.
Some of our forms are employment application forms. We would like for applicants to ber able to upload their cover letter and resume when they fill out their application.
Any ideas on how this can best be accomplished?We support attaching files to the form submission. This tutorial explains how to set it up:
http://forums.adobe.com/docs/DOC-2656
Randy -
How to upload pictures, contacts, and other things from my old iPhone
How to upload all my pictures, contacts, and other things from my old iPhone
If you want everything copied over then you can copy your iTunes downloads over to your computer's iTunes library by connecting it and doing File > Devices > Transfer Purchases and you can then backup up your old phone via File > Devices > Back Up - you can then restore that backup onto your new phone (or iPad as this is the Using iPad forum).
Backups and restores : http://support.apple.com/kb/HT4079
Transfer content to a new device : http://support.apple.com/kb/HT2109 (you can also backup/restore via iCloud, but not all iTunes content is redownloadble, so you might not get all items copied over). -
How to upload file from desktop or C drive and send as attachments
Hello Experts,
Please tell me
How to upload jpg or gif or drawing files from desktop or any drive and store into R/3 by the same time I have to send mail as a attachment.
I heard that FM
SO_NEW_DOCUMENT_ATT_SEND_API1 is only to send as a attachment what ever the data is present in the internal table only.
please help me on that.I m using this code its having attachment but I m not able to open the file. Please help me
I m using gui_upload to upload the file
PROGRAM ZTEST
no standard page heading line-size 255.
DATA: xfile TYPE string.
data : t_IW51 LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
data : email type table of BAPIADSMTP.
PARAMETERS : file LIKE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
CLEAR file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = file.
xfile = file.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = xfile
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = t_IW51.
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Send External Mail'.
Mail Contents
OBJTXT = 'Minimum bid : $250000'.
APPEND OBJTXT.
OBJTXT = 'A representation of the pictures up for auction'.
APPEND OBJTXT.
OBJTXT = 'was included as attachment.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
(Assume that the data in OBJBIN is in BMP format)
*OBJBIN = ' \O/ '. APPEND OBJBIN.
*OBJBIN = ' | '. APPEND OBJBIN.
*OBJBIN = ' / \ '. APPEND OBJBIN.
OBJBIN[] = t_IW51[].
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'PICTURE.PDF'.
APPEND OBJHEAD.
OBJBIN[] = t_IW51[].
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'PICTURE'.
OBJPACK-OBJ_DESCR = 'Representation of object 138'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
RECLIST-RECEIVER = 'email_id have to enter here'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
RECLIST-RECEIVER = 'ENTEG01'.
RECLIST-REC_TYPE = 'P'.
APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
commit_work = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
*EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
*OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
WRITE: / 'Result of the send process:'.
LOOP AT RECLIST.
WRITE: / RECLIST-RECEIVER(48), ':'.
IF RECLIST-RETRN_CODE = 0.
WRITE 'The document was sent'.
ELSE.
WRITE 'The document could not be sent'.
ENDIF.
ENDLOOP.
WHEN 1.
WRITE: / 'No authorization for sending to the specified number',
'of recipients'.
WHEN 2.
WRITE: / 'Document could not be sent to any recipient'.
WHEN 4.
WRITE: / 'No send authorization'.
WHEN OTHERS.
WRITE: / 'Error occurred while sending'.
ENDCASE. -
How to upload data from excel to SAP and options to be used
How to upload data from excel to SAP and options to be used
thank you,
Regards,
Jagrut Bharatkumar shuklaHi Jagrut,
You can use gui_upload.
chk the sample program mentioned below.
REPORT ZFTP .
DATA: BEGIN OF I_FILE OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE.
DATA: BEGIN OF I_FILE2 OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE2.
DATA: W_COUNT TYPE I.
PARAMETERS: P_FILEN TYPE STRING,
P_FILE2 TYPE STRING,
P_NUM(4) TYPE N..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILEN.
PERFORM F_FILE_GET USING P_FILEN TEXT-G01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE2.
PERFORM F_FILE_GET USING P_FILE2 TEXT-G01.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = P_FILEN
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = I_FILE
IF SY-SUBRC <> 0.
MESSAGE E024(Z1).
ENDIF.
LOOP AT I_FILE.
W_COUNT = W_COUNT + 1.
IF NOT W_COUNT > P_NUM.
MOVE I_FILE TO I_FILE2.
APPEND I_FILE2.
ENDIF.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = P_FILE2
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = I_FILE2
FIELDNAMES =
*& Form F_FILE_GET
text
-->P_P_FILEN text
-->P_TEXT_G01 text
FORM F_FILE_GET USING L_FILENA L_TEXT.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,*.TXT.'
MODE = 'O'
TITLE = L_TEXT
IMPORTING
FILENAME = L_FILENA
rc =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward if helpful.
Regards,
Harini.S -
How to upload a text file from a shared folder and provide an o/p
how to upload a text file from a shared folder and provide an o/p containing the details in each order in the text file
Hi,
Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
Now, I hope the code for data fetching, if required, is already present in the report.
Reward points if the answer is helpful.
Regards,
Mukul -
How to Upload Closing balances of ECS and SHECS
Hi Experts ,
Please let me know how to upload closing balances of Education cess and Higher Secondary Education cess of Excise duties
Thanks in advance
GMRhi
Through Table J2_IACCBAL (OPENING/CLOSING ACC.BALANCE TABLE) -
How to upload and edit an eps file
Hi all,
I have just downloaded an eps file from shutterstock and they given me this free trial idea with adobe but unfortunately i have got no idea how to upload my file and edit it and save it as a jpg file for further work. can anyone help me pleaseyou can use adobe illustrator to open that file.
-
How to upload Training history in Training and event management .
Hi,
How to upload Training history in Training and event management through which transaction.plz reply at early.Hi,
You can create LSMWs to
1. create event PV10/PV11
2. Firmly book event PV12 (else can directly create firmly booked events)
3. Book attendee PV00
4. Follow up PV15 ( u can use n LSMW here provided all the emps get same level of proficiency after attendin n event. u wont be able to chnge proficiency level at the time of follow up usin LSMW)
Regards,
Shreyasi. -
How to upload pdf file in iphone and how to view
how to upload and how to view pdf file in iphone 5s
Hey saif.antri,
You can view PDFs and more using iBooks on your iPhone:
iBooks: Viewing, syncing, saving, and printing PDFs on iPhone, iPad, and iPod touch
http://support.apple.com/kb/HT4227
Have a great day,
Delgadoh
Maybe you are looking for
-
How do I add a printer connected to another iMac on the network to my printer list?
How do I add an Epson printer connected to an iMac on the network to the printer list on my MacBook Pro? I cannot get it to show up in the list for printers to add.
-
should both the source and lookup tables be in the same schema??? i choose the source table from one schema and the lookup tabel from another schema,so when i try to save it, i get an error saying *"In order to create a lookup ,you must be sure that
-
Live paint to image without covering lines in image?
I am using Live Paint in CS5 after tracing a line drawing, and I am finding that I am able to apply paint to the image, though it is covering up some of the lines. How canI apply the paint while making sure that the lines are not painted over? Thanks
-
We need to control access to certain application functionality in our system. We are currently using the application users' role(s) to decide whether access is granted to for instance view products with a value greater than £100. The role which allow
-
Hello, i have a file employee1.xsql: <?xml version='1.0'?> <xsql:query xmlns:xsql="urn:oracle-xsql" connection="employee" rowset-element="OK" row-element="EMPLOYEE"> SELECT employee_id "ID" ,last_name "NAME" ,job_id "JOB" ,salary "SALARY" ,commission