Unable to upload File to DMS (Document Managemt Sys) Via web Dynpro App

Hi .
I want add file to DMS i,e, SAP Document Management System .
I first tried calling BAPI : BAPI_CREATE_DOCUMENT2 in Report and I was successfull.
I am trying out same thing via Web Dynpro Application but I am getting error in Return of BAPI .Error is Error while checking in and storing: C:\Documents and Settings\Desktop\Hi.doc.
I am pasting code I have written on click of Upload .
method ONACTIONON_UPLOAD .
implicitly available data objects
wd_Context type ref to if_wd_context_node.
wd_This type ref to if_FileUpload.
DATA: gv_documento TYPE draw-doknr ,
gv_clase TYPE draw-dokar VALUE 'Z99' ,
gv_version TYPE draw-dokvr VALUE '00',
gv_part TYPE draw-doktl VALUE '000',
gv_descripcion TYPE drat-dktxt VALUE 'Description111',
gv_return TYPE bapiret2,
filename(60) type c ,
lt_documentdata TYPE STANDARD TABLE OF bapi_doc_draw2,
ls_documentdata LIKE LINE OF lt_documentdata,
lt_characteristicvalues TYPE STANDARD TABLE OF bapi_characteristic_values ,
lt_classallocations TYPE STANDARD TABLE OF bapi_class_allocation ,
lt_documentfiles TYPE STANDARD TABLE OF bapi_doc_files2 ,
ls_documentfiles LIKE LINE OF lt_documentfiles ,
lv_content type xstring ,
size type i.
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_filename LIKE ls_context-filename.
get element via lead selection
lo_el_context = wd_context->get_element( ).
get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `FILENAME`
IMPORTING
value = lv_filename ).
ls_documentdata-documenttype = 'Z99'.
ls_documentdata-documentversion = '000'.
ls_documentdata-documentpart = '00'.
ls_documentdata-description = 'Test Document Created Parag'.
ls_documentdata-STATUSEXTERN = 'WR'.
ls_documentdata-USERNAME = 'I046361'.
ls_documentdata-WSAPPLICATION1 = 'DOC'.
ls_documentdata-DOCFILE1 = lv_filename.
ls_documentdata-DATACARRIER1 = 'DEFAULT'.
ls_documentfiles-wsapplication = 'DOC'.
ls_documentfiles-docfile = lv_filename.
ls_documentfiles-storagecategory = 'DMS_C1_ST'.
ls_documentfiles-checkedin = 'X'.
APPEND ls_documentfiles to lt_documentfiles.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_documentdata
pf_http_dest = 'SAPHTTP'
IMPORTING
return = gv_return
TABLES
documentfiles = lt_documentfiles.
IF gv_return-type CA 'AE'.
WRITE gv_return-message.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF .
endmethod.
Now Can anyone tell
In case of Web Dynpro what Is this code right ?
Do I need to change value of Parameters I have Set ?
Do i need to some change as I am trying to Upload file Via WebApplication ?
Do I have to change data Carrier ?
Please let me know urgently .Points will be surely Given ...
Regards ,
Parag

Hi ,
Finally I was successfull in Uploading Docs.It seems I was not getting right Parameters ..anyways correct code is as follows ...
method ONACTIONON_UPLOAD .
  implicitly available data objects
  wd_Context type ref to if_wd_context_node.
  wd_This    type ref to if_FileUpload.
DATA:     gv_documento    TYPE draw-doknr            ,
          gv_clase        TYPE draw-dokar   VALUE 'Z99'  ,
          gv_version      TYPE draw-dokvr              VALUE '00',
          gv_part         TYPE draw-doktl VALUE '000',
          gv_descripcion  TYPE drat-dktxt VALUE 'Description111',
         gv_return       TYPE  BAPIRETURN ,
          gv_return       TYPE  BAPIRET2 ,
          gv_ruta         TYPE bapi_doc_files2-docfile VALUE 'C:\BAPI_DMS.doc' ,
          filename(60) type c ,
          lt_documentdata         TYPE STANDARD TABLE OF bapi_doc_draw2,
          ls_documentdata         LIKE LINE OF  lt_documentdata,
          lt_characteristicvalues TYPE STANDARD TABLE OF bapi_characteristic_values ,
          lt_classallocations     TYPE STANDARD TABLE OF bapi_class_allocation ,
          lt_documentfiles        TYPE STANDARD TABLE OF bapi_doc_files2 ,
          ls_documentfiles        LIKE LINE OF lt_documentfiles ,
          lv_content type xstring ,
          size type i ,
          lt_binary              TYPE TABLE OF sdokcntbin ,
          ls_binary              LIKE LINE OF lt_binary ,
          lv_size                TYPE I  ,
          ls_doc_status          TYPE  CVAPI_DOC_STATUS ,
          ls_API_ctrl            TYPE  CVAPI_API_CONTROL ,
          l_MSG                  TYPE  MESSAGES ,
          lt_files type STANDARD TABLE OF CVAPI_DOC_FILE  ,
          lt_drao  TYPE STANDARD TABLE OF DRAO  ,
          ls_drao  LIKE LINE OF lt_drao ,
          lv_documenttype      TYPE  DRAW-DOKAR ,
          lv_documentnumber TYPE  DRAW-DOKNR ,
          lv_documentversion TYPE  DRAW-DOKVR ,
          lv_documentpart  TYPE  DRAW-DOKTL ,
          lv_text          TYPE string .
      FIELD-SYMBOLS <fs> TYPE ANY.
  DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_filename LIKE ls_context-filename   .
get element via lead selection
  lo_el_context = wd_context->get_element(  ).
get single attribute
  lo_el_context->get_attribute(     EXPORTING       name =  `FILENAME`     IMPORTING       value = lv_filename ).
  lo_el_context->get_attribute(     EXPORTING       name =  `FILECONTENT`     IMPORTING       value = lv_content ).
CONCATENATE lv_text 'by' sy-uname 'cretaed at ' sy-uzeit INTO lv_text .
  ls_documentdata-documenttype    = 'Z99'.
  ls_documentdata-documentversion = '00'.
  ls_documentdata-documentpart    = '000'.
  ls_documentdata-description     = 'Test Document Created in Web Dynpro ABAP '.
  ls_documentdata-STATUSEXTERN    = 'WR'.
  ls_documentdata-USERNAME        = 'I046361'.
  ls_documentdata-WSAPPLICATION1 = 'DOC'.
  ls_documentdata-DOCFILE1        = lv_filename.
  ls_documentdata-DATACARRIER1    = 'DEFAULT'.
  ls_documentfiles-DOCUMENTTYPE       = 'Z99'.
  ls_documentfiles-WSAPPLICATION      = 'DOC'.
  ls_documentfiles-DOCUMENTVERSION    = '00'.
  ls_documentfiles-DOCUMENTPART       = '000'.
  ls_documentfiles-DOCFILE            = lv_filename.
  ls_documentfiles-description        = 'Test Document Created in Web Dynpro ABAP  '.
  ls_documentfiles-CREATED_BY         = sy-uname.
  ls_documentfiles-CHECKEDIN          = 'X'.
  ls_documentfiles-DOCFILE            = lv_filename.
  APPEND ls_documentfiles  to lt_documentfiles .
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
        documentdata    = ls_documentdata
        pf_http_dest    = 'SAPHTTPA'
    IMPORTING
        DOCUMENTNUMBER  = lv_DOCUMENTNUMBER
        return          = gv_return
    TABLES
      documentfiles = lt_documentfiles.
IF gv_return-type CA 'AE'.
  WRITE gv_return-message.
ELSE.
   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING     wait = 'X'.
   get message manager
   data lo_api_controller     type ref to if_wd_controller.
   data lo_message_manager    type ref to if_wd_message_manager.
   lo_api_controller ?= wd_This->Wd_Get_Api( ).
   CALL METHOD lo_api_controller->GET_MESSAGE_MANAGER
     RECEIVING
       MESSAGE_MANAGER = lo_message_manager
CLEAR lv_text .
CONCATENATE 'Dcoument ' lv_filename 'Successfully stored with Document No. ' lv_DOCUMENTNUMBER INTO lv_text .
   report message
   CALL METHOD lo_message_manager->REPORT_SUCCESS
     EXPORTING
       MESSAGE_TEXT             = lv_text
      PARAMS                   =
      MSG_USER_DATA            =
      IS_PERMANENT             = ABAP_FALSE
      SCOPE_PERMANENT_MSG      = CO_MSG_SCOPE_CONTROLLER
      VIEW                     =
      SHOW_AS_POPUP            =
      CONTROLLER_PERMANENT_MSG =
      MSG_INDEX                =
      CANCEL_NAVIGATION        =
ENDIF .
endmethod.

Similar Messages

  • Not able to upload file in DMS(Document Mang. system) using Web dynpro ABAP

    Hi All,
    I am facing a problem while uploading the file into the DMS ( Document Management System ) from Webdnrpo .
    I am using the BAPI - BAPI_DOCUMENT_CREATE2 to create the document .
    CASE - 1
    when i am providing the storage category mention below and no data carrier1
    ls_documentfiles-storagecategory = 'ZHMEL_CS'.  it is not able to upload the document in the DMS system and when i check
    in the debugg mode it giving error as  ""Error while checking in and storing: C:\TEST.TXT "" .
    CASE - 2
    When i am not using the storage category and providing the the data carrier as default
    ls_documentdata-DATACARRIER1 = 'DEFAULT'. It is able to create the document in the DMS but i am not able to read that document .
    I checked with DMS Consultant that DMS is configured for  ZOL ( documenttype) with a storage category  as 'ZHMEL_CS'.
    The code which i have used is below :
    ls_documentdata-documenttype = 'ZOL'.
    ls_documentdata-documentversion = '00'.
    ls_documentdata-documentpart = '000'.
    ls_documentdata-description = 'Test Document'.
    ls_documentdata-laboratory = '001'.
    ls_documentdata-WSAPPLICATION1 = 'TXT'.
    ls_documentdata-DOCFILE1 = 'C:\TEST.TXT'.
    ls_documentdata-SAVEDOCFILE1 = 'C:\TEST.TXT'.
    *ls_documentdata-FILESIZE1 = 000000000000.
    *ls_documentdata-FILESIZE2 = 000000000000.
    ls_documentdata-WSAPPLICATION1 = 'TXT'.
    ls_documentfiles-DOCUMENTTYPE = 'ZOL'.
    ls_documentfiles-DOCUMENTPART = '000'.
    ls_documentfiles-DOCUMENTVERSION = '00'.
    ls_documentfiles-storagecategory = 'ZHMEL_CS'.
    ls_documentfiles-WSAPPLICATION = 'TXT'.
    ls_documentfiles-DOCPATH = 'C:\'.""lv_filename.
    ls_documentfiles-DOCFILE = 'TEST.TXT'."lv_filename.
    ls_documentfiles-description = 'Test Document'.
    ls_documentfiles-language = 'EN'.
    ls_documentfiles-CHECKEDIN = 'X'.
    APPEND ls_documentfiles to lt_documentfiles .
    *&----Fill Descriptions
    w_descr-language = 'EN'.
    w_descr-language_iso = 'EN'.
    w_descr-description = 'Test'.
    append w_descr to lt_descr.
    clear w_descr.
    **w_hostname = 'HMEL-DV1R3_DR3_00'.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
    documentdata = ls_documentdata
    *hostname = 'content-srv'
    *pf_http_dest = 'SAPHTTPA'
    *pf_ftp_dest  = 'SAPFTPA'
    IMPORTING
    DOCUMENTNUMBER = lv_DOCUMENTNUMBER
    return = gv_return
    TABLES
    documentdescriptions       = lt_descr
    documentfiles              = lt_documentfiles.
    Please let me know your valuable inputs on the same ..
    Edited by: Omm Awasthi on Dec 30, 2010 12:22 AM
    Edited by: Omm Awasthi on Dec 30, 2010 12:25 AM

    Hi omm , from functional side your require a document type and content repository
    I have used below code in a function module to create document , we have create object link as PO to the doc.
    FUNCTION ZFM_SR_CREATE_FROM_EXTERNAL .
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(IV_DOCUMENTNUMBER) TYPE  DOKNR OPTIONAL
    *"     VALUE(IV_DOCUMENTTYPE) TYPE  DOKAR OPTIONAL
    *"     VALUE(IV_DOCUMENTVERSION) TYPE  DOKVR OPTIONAL
    *"     VALUE(IV_DOCUMENTPART) TYPE  DOKTL_D OPTIONAL
    *"     VALUE(IV_STORAGE_CAT) TYPE  CV_STORAGE_CAT OPTIONAL
    *"     VALUE(IV_DOKST) TYPE  DOKST OPTIONAL
    *"     VALUE(IT_DM_FILES) TYPE  ZDM_TT_FILES OPTIONAL
    *"     VALUE(IV_EBELN) TYPE  EBELN
    *"  EXPORTING
    *"     VALUE(EV_DOCUMENTNUMBER) TYPE  DOKNR
    *"     VALUE(ES_RETURN) TYPE  BAPIRET2
    V00.00  DD.MM.YYYY                                                   *
    *********************New Method of Uploading File*********************************
      CONSTANTS path_name    TYPE dms_path
               VALUE '/tmp/'.
      CONSTANTS log TYPE dms_path VALUE '/tmp/logFO.txt'.
      DATA: ls_draw TYPE bapi_doc_draw2,
            lt_documentfiles TYPE TABLE OF bapi_doc_files2,
            ls_documentfiles TYPE bapi_doc_files2,
            ls_dm_files TYPE zdm_files,
            lv_filename TYPE string,
            lv_ext TYPE string,
            lv_file_type TYPE draw-dappl,
            lv_file_name TYPE dms_path,
            lv_msg(80) TYPE c,
            lt_objectlinks TYPE TABLE OF bapi_doc_drad,
            ls_objectlinks TYPE bapi_doc_drad,
            lv_ebelp   TYPE ebelp
    Prepare Data
      MOVE iv_documentnumber TO ls_draw-documentnumber.
      MOVE iv_documenttype TO ls_draw-documenttype.
      MOVE iv_documentversion TO ls_draw-documentversion.
      MOVE iv_documentpart TO ls_draw-documentpart.
      ls_draw-statusextern = iv_dokst.
      ls_draw-statusintern = iv_dokst.
      ls_draw-username = sy-uname.
      LOOP AT it_dm_files INTO ls_dm_files.
        SPLIT ls_dm_files-filepath AT '.' INTO lv_filename lv_ext.
        CALL FUNCTION 'CV120_DOC_GET_APPL'
          EXPORTING
            pf_file   = ls_dm_files-filepath
          IMPORTING
            pfx_dappl = lv_file_type.
        TRANSLATE lv_file_type TO UPPER CASE.
        OPEN DATASET log FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        TRANSFER lv_ext TO log.
        ls_documentfiles-wsapplication = lv_file_type.
        TRANSLATE ls_documentfiles-wsapplication TO UPPER CASE.
        CONCATENATE path_name
                           lv_filename
                            lv_ext
                            INTO lv_file_name.
        CONDENSE lv_file_name  NO-GAPS.
        TRANSFER lv_file_name TO log.
        OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.
    *Transfer Attachment Content to Application Server
        TRANSFER ls_dm_files-content TO lv_file_name.
        CLOSE DATASET lv_file_name.
        TRANSFER 'move data to lt_files' TO log.
        ls_documentfiles-storagecategory = iv_storage_cat.
        ls_documentfiles-docfile = lv_file_name.
        ls_documentfiles-DOCUMENTVERSION = IV_DOCUMENTVERSION.
        APPEND ls_documentfiles TO lt_documentfiles.
        CLEAR lv_file_name.
        CLOSE DATASET log.
      ENDLOOP.
      IF iv_ebeln IS NOT INITIAL.
        ls_objectlinks-objecttype = 'EKPO'.
        SELECT SINGLE ebelp INTO lv_ebelp FROM ekpo WHERE
                                          ebeln = iv_ebeln
                                          AND loekz eq space.
        CONCATENATE iv_ebeln lv_ebelp INTO ls_objectlinks-objectkey.
        APPEND ls_objectlinks TO lt_objectlinks.
      ENDIF.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
       EXPORTING
         documentdata   = ls_draw
         pf_ftp_dest    = 'SAPFTPA'
         pf_http_dest   = 'SAPHTTPA'
       IMPORTING
         documentnumber = ev_documentnumber
         return         = es_return
       TABLES
         objectlinks          = lt_objectlinks
         documentfiles  = lt_documentfiles.
    DATA:   ls_doc_data  type bapi_doc_draw2,
       ls_doc_datax type bapi_doc_drawx2,
       ls_return type bapiret2.
    Set value for document data
      ls_doc_data-statusextern  = 'IW'.
      ls_doc_data-statusintern  = 'IW'.
    Set value for document data check
    ls_doc_datax-statusextern = 'X'.
    ls_doc_datax-statusintern = 'X'.
    CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
      EXPORTING
        DOCUMENTTYPE               = 'ROS'
        DOCUMENTNUMBER             = IV_DOCUMENTNUMBER
        DOCUMENTPART               = IV_DOCUMENTPART
        DOCUMENTVERSION            = IV_DOCUMENTVERSION
        DOCUMENTDATA               = ls_doc_data
        DOCUMENTDATAX              = ls_doc_datax
      HOSTNAME                   =
      DOCBOMCHANGENUMBER         =
      DOCBOMVALIDFROM            =
      DOCBOMREVISIONLEVEL        =
      SENDCOMPLETEBOM            = ' '
          pf_ftp_dest    = 'SAPFTPA'
          pf_http_dest   = 'SAPHTTPA'
      CAD_MODE                   = ' '
      ACCEPT_EMPTY_BOM           = ' '
    IMPORTING
       RETURN                     =  ls_return
    TABLES
      CHARACTERISTICVALUES       =
      CLASSALLOCATIONS           =
      DOCUMENTDESCRIPTIONS       =
      OBJECTLINKS                =
      DOCUMENTSTRUCTURE          =
       DOCUMENTFILES              = lt_documentfiles.
      LONGTEXTS                  =
      COMPONENTS                 =
      move es_return to ES_RETURN.
      IF es_return-type CA 'EA' ."NE 'E' AND es_return-type NE 'A'.
        "do nothing
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait = 'X'.
      ENDIF.
      LOOP AT lt_documentfiles INTO ls_documentfiles.
        DELETE DATASET ls_documentfiles-docfile.
      ENDLOOP.
    ENDFUNCTION.

  • Upload file and send them by email on Web Dynpro abap

    Hi experts.
    I Need a help.
    I want to upload a file (  any type, Word, Excel, pdf, image)  and send this file by email on abap web dynpro.
    But a have a problem. the web dynpro upload functionality return a xstring value like content of this file. but the FM SO_NEW_DOCUMENT_ATT_SEND_API1 receives a table with a line type SO_RAW255 RAW 255 0 SAPoffice: Binary data with length 255 to attachment.
    Now, how can I transform the xstring into this type of table?? or there is another way by send an email with the xstring like attachment??? or what can I do?
    Thank in advance.

    Please check fm
    SCMS_BINARY_TO_FTEXT

  • Unable to upload files via Wi-Fi.

    My phone C3-00 is running on latest update v08.71. I'm unable to upload files on wi-fi. When I start any service like Facebook on opera mini or any browser (I'm also unable to use Mail & Communities via wi-fi) and try to upload file (pic. of max. size 500KB) it shows uploading two times then shows connection failed. I tried it several times but everytime it shows connection failed. But I can easily upload files via GPRS. The Mail & Communities app also runs fine on GPRS but not works on Wi-Fi. Please solve my problem.

    Read my previous post /t5/Phone-Applications/Nokia-apps-on-Wi-Fi/m-p/1305667#M25965

  • I am unable to upload Quicktime movies made with imovie to the web.  I've tried using Filezilla (which worked well until recently) or even going directly to the webhost via Cox.  The upload gets caught in a loop.  nojo99

    I am unable to upload Quicktime movies made with imovie to the web.  I've tried using Filezilla (which worked well until recently) or even going directly to the webhost via Cox (my internet provider).  The upload always gets caught in a loop.  I  have repaired permissions.  I've been successfully uploading movies each week to my church website (or intermediary like Filezilla) for over a year.  I cannot figure out why I'm no longer successful.  Your feedback is desired and welcome.  nojo99

    I am unable to upload Quicktime movies made with imovie to the web.  I've tried using Filezilla (which worked well until recently) or even going directly to the webhost via Cox (my internet provider).  The upload always gets caught in a loop.  I  have repaired permissions.  I've been successfully uploading movies each week to my church website (or intermediary like Filezilla) for over a year.  I cannot figure out why I'm no longer successful.  Your feedback is desired and welcome.  nojo99

  • I am unable to upload files via web browser

    Good morning
    I have just upgraded to Mavericks (10.9.5), and I am running into a weird issue. I am unable to upload any files via the web browser. If I go to a website, and select an Upload File option, I am taken to Finder, where I am able to select the file, and press attach. The issue comes when I press upload on the website. It always either times out, or gives me an error that I was disconnected from the server. This happens on Safari, Firefox, and Chrome. I'm not sure what to do... I've repaired disk permissions and tried a lot of different security settings, but I am stumped.
    Thank you

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen. Click the Clear Display icon in the toolbar. Then take one of the actions that you're having trouble with. Select any messages that appear in the Console window. Copy them to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of which is irrelevant to solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Unable to upload Files to child site collection using REST

    Dear All,
    I referred this article http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx for uploading documents to SP Document Library and it works fine for any document library under the root site collection(
    for example "http://<server name>/Shared Documents" but when i upload the same document to one of the sub site collection created using Managed Path( the site collection path is "http://<server name>/files/Case" and the library
    name is "records") it fails and i get below error:
    The security validation for this page is invalid. Click Back in your
    Web browser, refresh the page, and try your operation again, Error Code -2130575251 Microsoft.SharePoint.SPException"
    Any help suggestion to resolve this? I've almost tried everything to resolve this issue but no luck.. appreciate any help
    for this..
    Regards,
    Vishal

    Hi,
    According to your post, my understanding is that you had an issue uploading files to subsite using REST.
    I had made a simple code demo below, it will upload a file to Document Library after you make your selection with the File control.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function uploadFile(){
    //alert(2);
    if (document.getElementById("file").files.length === 0) {
    alert('No file was selected');
    return;
    var parts = document.getElementById("file").value.split("\\");
    var filename = parts[parts.length - 1];
    var file = document.getElementById("file").files[0];
    uploadFileSync("http://YourSite", "Documents", filename, file);
    //Upload file synchronously
    function uploadFileSync(spWebUrl , library, filename, file)
    //alert(3);
    var reader = new FileReader();
    reader.onloadend = function(evt)
    if (evt.target.readyState == FileReader.DONE)
    var buffer = evt.target.result;
    var completeUrl = spWebUrl
    + "/_api/web/lists/getByTitle('"+ library +"')"
    + "/RootFolder/Files/add(url='"+ filename +"',overwrite='true')?"
    + "@TargetLibrary='"+library+"'&@TargetFileName='"+ filename +"'";
    $.ajax({
    url: completeUrl,
    type: "POST",
    data: buffer,
    async: false,
    processData: false,
    headers: {
    "accept": "application/json;odata=verbose",
    "X-RequestDigest": $("#__REQUESTDIGEST").val(),
    "content-length": buffer.byteLength
    complete: function (data) {
    //uploaded pic url
    console.log(data.responseJSON.d.ServerRelativeUrl);
    error: function (err) {
    alert('failed');
    reader.readAsArrayBuffer(file);
    </script>
    <input type="file" id='file' onchange="uploadFile()"/>
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • Unable to upload files from local computer to remote server (Was: Dreamweaver)

    I have lost the connection between the remote location and the local location for files on my computer. Where to I correct this issues, since I cannot upload files from local to remote. Host server from server to my computer works fine, Running Dell computerr XP operating system with CS3 Dreamweaver. Need all the help I can get.

    I am now having a "ftp error - cannot make connection to host. Dreamweaver
    encoutered a netwoerk or file system error. I did as you suggested and I
    get to basic site definition, ( which looks o.k.), next screen ( no,I do
    not want to use a server technology) Next screen ( edit local copies on my
    machine ( file location looks o.k.), next screen (connect to remote
    server=ftp) address of web server is correct, ( no folder on server, or ftp
    login or ftp password) do not enable check in or check out
    summary: local
    Site name:midhba
    local root folder:midhba
    remote info:
    access; ftp
    FTP host: midhba.com
    check in.check out diabled
    testing server (set up later)

  • Unable to upload files to wiki service

    Hi, I tried today to enable the wiki service for the first time.  Everything seemed ok—it turns on, I can log in, I can create wikis and files.  However, when i attempt to upload a file the spinner continues forever and the file does not upload.  Looking at /Library/Server/Wiki/Logs/coreclient.log shows an error (sorry I have to key this in, not copy/paste):
    InvalidAuthenticityToken exception for request - CSRF token may be missing
    This is followed by a bunch of debug output from Ruby, and then this:
    ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken):
      app/controllers/application_controller.rb:685: in `handle_unverified_request'
    I didn't find any other references to these errors in some searches I did.  Does anyone have an idea what is going wrong?
    My server is 10.8.3, latest Server.app
    Thanks,
    Brian

    Hi,
    Firstly, please check Event Viewer and it should identify what's the reason cause IE crash.
    Secondly, have you tried other browser for test to upload file?
    Roger Lu
    TechNet Community Support

  • Unable to upload files using firefox, be it dropbox, gmail or any other websites where we need to attach files. It does not open up a new window to choose file.

    all of a sudden im unable to attach files in any of the websites. Im using firefox version 30 and when I click to attach file it does not open up a new window where we can choose the file from my computer. It happens almost in all websites that I use (gmail, dropbox, other websites).
    This was not the case before, seem some problem with firefox.. can somebody fix this at the earliest. thanks

    hello Balaatmozilla,
    please check if this problem appears as well when you try to download a file, does this happen again when you try to download a file?
    if so there must be a problem with your HDD controler, to solve this issue follow th steps:
    1.Right Click on My Computer, Select Properties
    2.Click on Device Manager in Top Left corner
    3.expand the IDA/ATI/ATAPI controllers
    4.right click on the one which is related to your HDD
    5.click on Uninstall
    6.Restart
    when you restart your windows the OS will try to install the drivers again, if this happens then restart again and check if the problem is solved, if no try to install the HDD drivers and related drivers manually and then restart your machine

  • Unable to upload files to server via Transmit (ftp client)

    Hi For some reason I am no longer able to upload files via Transmit to my website server. I have built several sites hosted on different servers and I cant access any of them, so it is obviously a problem at my end. The Message I get when I try to connect is .... 'Server said authentication failed'.
    I used to have no problems with access. The only thing that has physically changed in my setup is that I am now running my computer directly from the Modem (D-Link DSL 300T) through the Ethernet port as my airport express decided to blow up a couple of months ago. I have also done several apple software updates, so I dont know if this has affected it. My firewall is on, but I have ftp access ticked. Can anyone please help, I dont know what else to try.
    Many Thanks
    Rob

    How would I access the server security logs?
    That would depend on the OS and your level of access. If it's a Linux server you would want to check the ftp entries in /var/log/secure as that is where authentication failures are logged. If it's a web hosting account on a shared server you may need to ask your support contact where your ftp logs are located.
    You might try connecting manually using the ftp command in the terminal window. If you can log in that way, the problem is most likely with your Transport settings. If you can't log in that way, you may at least get a more detailed error message.

  • Unable to upload files to attach to my hotmail.

    I have been un-able to upload files to attach to my email for some time now.  I have un-installed and re-installed Internet explorer, disabled all add on's, re-set settings on internet explorer, completely shut down computer and re-stared several times.
    changed my security settings, nothing works! Once in a while it does work, but then I will try again, and the screen freezes and when I ctrl-alt-delete it says Internet Explorer has stopped working. I work from home, and need to send PDF files thru email daily
    for work.
    Please help me figure this out! We use Windows 7, and the newest version of Internet Explorer. Thank you!

    Hi,
    Firstly, please check Event Viewer and it should identify what's the reason cause IE crash.
    Secondly, have you tried other browser for test to upload file?
    Roger Lu
    TechNet Community Support

  • Unable to upload files via admin & FTP

    I've been trying to upload files to this site, but it keeps on bringing errors. It worked fine 20 minutes ago. Now the FTP doesn't upload and the Admin File Manager brings back errors on upload as well. Anyone know what's going on? The system status gives all green dots about all servers and doesn't say anything about disabled FTP or File Upload: http://status.businesscatalyst.com/

    There was scheduled maintenance today. But the status page doesn't have anything about what is going on. The last update was three hours ago saying hotpatch deployment was competed.

  • Unable to upload file more than 1 MB

    Hi,
    I am using the iPlanet web server for my web application.
    I am not able to upload a file of size greater than 1MB.
    Are there any settings on the iplanet server made that limit the file size for the uploading?
    Regards,
    Manasi

    Hi Mansi,
    It is not because of App server. It is due to the program/logic that you are using. There is one very good file upload application is available in open source where you can upload the attachments of 10mb within very less time.
    Download the jar from the following URL
    http://servlets.com/cos/
    Regards,
    Sandeep

  • Problem with uploading files to SharePoint 2013 in cloud using web services. Keep getting error message and don't know why.

    Hello everyone. I am having trouble writing a utility that uses SharePoint web services to upload a file and metatag it. It keeps throwing the following error message:
    "The request failed with the error message: -- <html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="/_forms/default.aspx?ReturnUrl=%2fsites%2fgk%2f_vti_bin%2fcopy.asmx">here</a>.</h2>
    </body></html> --."
    Not sure why. I pass the file that I am going to upload to the subroutine and it is suppose to upload it to the appropriate library. I have burned several days on this problem and I am not sure what is going on. I would appreciate anyone that can point me in
    the right direction. Below is the subroutine that I have that is causing the problem. Obviously, I have stripped the name from the example.
    Thanks
    Mike
    ******** <Begin snip of code> **********************
    Public Shared Sub CreateNewDocumentWithCopyService(ByVal fileName As String)
    Dim c As New copyservice.Copy
    c.PreAuthenticate = True
    c.Credentials = New System.Net.NetworkCredential("[email protected]", "mypassword")
    c.Url = "https://x.sharepoint.com/sites/gk/_vti_bin/copy.asmx"
    Dim myBinary As Byte() = System.IO.File.ReadAllBytes(fileName)
    Dim destination As String = "https://x.sharepoint.com/sites/gk/Gatekeeper%20Reference/" & System.IO.Path.GetFileName(fileName)
    Dim destinationUrl As String() = {destination}
    Dim info1 As New copyservice.FieldInformation
    info1.DisplayName = "Title"
    info1.InternalName = "Title"
    info1.Type = copyservice.FieldType.Text
    info1.Value = "new title"
    Dim info2 As New copyservice.FieldInformation
    info2.DisplayName = "Modified By"
    info2.InternalName = "Editor"
    info2.Type = copyservice.FieldType.User
    info2.Value = "-1;#servername\\testmoss"
    Dim info As copyservice.FieldInformation() = {info1, info2}
    Dim resultTest As New copyservice.CopyResult
    Dim result As copyservice.CopyResult() = {resultTest}
    Try
    ' When creating new content use the same URL in the SourceURI as in the Destination URL argument
    c.CopyIntoItems(destination, destinationUrl, info, myBinary, result)
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    ******** <End snip of code> **********************

    Hi,
    If you want to upload a file to a library in SharePoint 2013 online, I suggest you use Client Object Model or REST API.
    The code snippets in the two threads below will be helpful:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/deac7cb7-c677-47b0-acdc-c56b32dfaac8/uploading-bigger-files-using-csom
    http://stackoverflow.com/questions/17057074/how-to-download-upload-files-from-to-sharepoint-2013-using-csom
    Uploading Files Using the REST API
    http://blogs.msdn.com/b/uksharepoint/archive/2013/04/20/uploading-files-using-the-rest-api-and-client-side-techniques.aspx
    You can handle the authentication with
    SharePointOnlineCredentials object:
    http://www.vrdmn.com/2013/01/authenticating-net-client-object-model.html
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Blue Ray Disk drive compatibility with DVD S Pro, Mac Pro

    Ok, I'll make this an official question, where might I find info on BDR drive compatibility with DVD S Pro, Mac Pro, etc? I'm a little surprised that there doesn't seem to be much info available. I can always use my Pioneer BDR-202 with a windows box

  • From Keynote to PPT (PPS)

    Good day I have Keynote '09 vr: 5.0.3 Incompatibilty keynote vs Powerpoint. Is there a theme in Keynote which is fully compatible to Powerpoint? I now have the transition time that changes from 6.00 sec to 1.5 sec in PPS. and transition format also n

  • Disable BlueTooth and WiFi

    How do you disable Bluetooth and wifi without physically removing the components?

  • 2 level approval for workflow

    Hi all, I am supposed to make an EP workflow for 2 level approval for absences or leaves. I am using a copy of workflow WS12300111. I am able to get the single level of approval, but not the second level. When the request goes to the second approver

  • VKOA Question

    Hello SAP Gurus: Could someone please explain why we maintain the GL accounts in 5 tables as shown in the first screen of VKOA. Also when we go to the next screen why do we have two columns for GL Account. Is there an explanation of this configuratio