How to get file name for failed request in JSOM

hello friends,
i am uploading files to sharepoint 2013 document library. due to some problem when a file is not uploaded request is failed and failed callback handler is executed. at this time how i can know for which file has not been uploaded.
as i am uploading multiple files so it is necessary to know for which file error occurs.
please help 
Thanks in advance.
Mukesh

Hi Z..
it will be hard for any one to understand the code. how ever I have provided bellow.
theme is I need to upload multiple files selecting one by one asynchronously when a file will begin to upload It will show status of file name with processing image. similarly for other files.
ones file successfully uploaded processing image will get hidden. and delete will appear.
when error occurs for a file then processing div need to be removed for which I need file name when request failed. in failed handler
function uploadData()
var input = $("#fldFile")[0];
if (input) {
$("#uploadedfile").append("<div class='file'><label>" + input.files[0].name + "</label><div class='image'><img src='/_layouts/15/KPMG.VendorPortal.DMS/processing.gif' alt='processing..'/><img src='/_layouts/15/KPMG.VendorPortal.DMS/error.png' alt='delete' style='display:none;' /></div>");
file = input.files[0];
filename = input.files[0].name;
fr = new FileReader();
fr.onload = uploaddocument;
fr.readAsDataURL(file);
function uploaddocument()
web = clientContext.get_web();
clientContext.load(web);
list = web.get_lists().getByTitle("TempLibrary");
rootFolderUrl = list.get_rootFolder();
file = this.result;
clientContext.load(rootFolderUrl);
clientContext.executeQueryAsync(onuploaddocumentsuccess, failed);
function onuploaddocumentsuccess()
fileCreateInfo = new SP.FileCreationInformation();
fileCreateInfo.set_url(rootFolderUrl.get_serverRelativeUrl() + "/" + foldername + "/" + filename);
fileCreateInfo.set_overwrite(true);
fileCreateInfo.set_content(new SP.Base64EncodedByteArray());
// Read the binary contents of the base 64 data URL into a Uint8Array
// Append the contents of this array to the SP.FileCreationInformation
var arr = convertDataURIToBinary(file);
for (var i = 0; i < arr.length; ++i) {
fileCreateInfo.get_content().append(arr[i]);
// Upload the file to the root folder of the document library
uploadedfile= list.get_rootFolder().get_files().add(fileCreateInfo);
clientContext.load(uploadedfile);
clientContext.executeQueryAsync(documentuploaded, documentfailed);
function documentuploaded()
var fname = uploadedfile.get_name();
$("#uploadedfile").children("div").each(function () {
var flabelname = $(this).children("label").text();
if (flabelname.trim() == fname.trim())
$(this).children("div").children("img").get(0).style.display="none";
$(this).children("div").children("img").get(1).style.display="block";
alert("uploaded");
function documentfailed(sender,args)
Mukesh

Similar Messages

  • How to get file names for one oracle directory object.

    Hi all ,
    I defined one oracle directory object . Now I want to know how many files stored under this object in physical directory and their names ? anyone know how to do it by pl/sql ?
    Thanks,
    George

    Chris Poole has an [XUTIL_FINDFILES package|http://www.chrispoole.co.uk/apps/xutlff.htm] which can do this in pure SQL. It does require, though, that your DBA install code in the SYS schema and that you rely on the behavior of an undocumented X$ table. That may not be possible in certain environments.
    I personally prefer a small Java stored procedure along the lines of [this one from Tom Kyte|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]. It isn't a pure PL/SQL solution, but it tends to fit relatively cleanly in any environment. Most DBAs will be willing to grant the privileges this sort of approach requires where they would be hesitant to grant the access necessary for XUTIL_FINDFILES.
    Justin

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

  • How to get an answer for Support Request Number 12...

    How to get an answer for Support Request Number 1277702580 ?

    Has your speed problem been resolved, or do you need assistance?
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • How to get file name of the form attachment?

    Hi,
    is there anybody who is able to help me with the following problem???
    I started my process from Workspace ES and as a first step I attached one locale file (IMG.JPG or IMG.TIF e.g.) as a form attachment. I used "Attachments" bookmark in the Workspace ES.
    I need to get file name of attached file in the process!!!
    I tried to use "getTaskAttachments" component to get file name of form attachment but without success. This component successfully obtained attached file an stored it in the variable (type list, subtype document) but didn't produce all file attribute informations such as basename or Content Type:
    Is there some possibility to obtain file name (including file extension) by using "standard" tools and components of ALC?
    Thanks for your suggestions.

    Hi LekomDev,
    I faced the same situation some time back and this is what I know.
    Based on the file type few of the attributes will or will not be populated. (This is what the official documentation says about Document attributes)
    The file name that you are looking for would mostly be in 'name' attribute of Document object. The 'wsfilename' attribute is the atrribute which gets used to show the file name into Attachments tab of the workspace.
    So, if you are just interested in knowing the filenames then 'name' attribute is the place that you are looking for.
    But if you are trying to solve an issue in which Attachments against a Task isn't showing the filenames properly then you would need to copy the 'name' attribute value into 'wsfilename' attribute and then the Attachmetns against a Task would have the correct names.
    Tip: Use the Record and Playback option of the workbench to inspect the Document variable and you would see all of the values for a Document variable at desired step in your orchestration.
    hope this helps,
    cheers,
    Parth Pandya
    Blog: http://livecyclekarma.wordpress.com

  • How To Get Attribute Names for a Particular VO

    Hi ,
    How To Get Attribute Names Of a Vo where I can Set Viewattributname To the Table RN Columns Where I am Adding Extra Columns Based on Some Condn..
    So wen i am creating new Column to existing Table RN and we Need to add Attribute Name Also...Rt..
    And How To get RelationShip Between Database Column Name and Java Vo Attribute Name
    Ex: PlanId is the Java VO Attribute Name for the Database Column PLAN_ID
    In The Same way Hw We Get the Relation ship for All other columns In the Controller Cllass ..
    Can Any One Reply as It is urgent Req...
    Thanks ,,
    Jithen

    Instead of using the VO attribute names to set and get values, best to go to the VO definition, click on Java, and generate the View Row Class with the accessors.
    In the class where you're trying to set attributes, instead of a Row class, use the View Row class of your VO (eg ViewObjectName's class would be ViewObjectNameRowImpl), and when retrieving a row from the VO, cast the row to the previously mentioned View Row Class.
    At that point you can use the View Row Class's methods that would perform sets and gets of each column.
    To get attribute names, I don't know off the top of my head, but there might be a method mentioned in the Javadoc for the ViewRowImpl or ViewObject or ViewObjectDefinition classes to get the attribute/column mapping, or perhaps you can somehow read the XML definition of the VO which has that mapping.
    Assuming business components were built automatically and no attribute names were overridden, intuitively the attribute name is a camelcase version of the column name, removing understores and capitalizing the character following the removed underscore - but that's not a fool proof approach. Just a general observation.
    Hope this helps.
    Edited by: user6631964 on Sep 16, 2010 12:31 PM

  • How to get file name in faultpolices file for file based rejection handler

    Hi All,
    I am implementing the file rejection handler in fault polices.xml
    Now i want to catch exact file name and use this in faultpolices.xml under Filename tag and move the rejected file to custom directory.
    Can some please let me know is it possible to catch the exact filename and use the same name in rejection handle.
    Suppose If we don't handle the rejection handler then these files will move to the default path in SOA HOME. But the file name remains the same. So i think this can be changed in SOA, but i am afraid i how can i do it.
    Please suggest me.
    Regards,
    Tarak.

    Hi,
    have a look at my new weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    to see how you can access filename
    Regards,
    michal

  • How to get file name in adapter module

    Hi all
    Is it possible to get the file name in a adapte module? If so how can I achieve this?

    Hi,
    Check below thread. it shows code for file name.
    [Re: Query regarding Adapter Module development]
    -Gouri

  • How to get file name using File adapter Sync read

    Hi All,
    I am using SOA 10.1.3.3 and JDEV 10.1.3.3.
    I have an async bpel process.
    I have to read file name in this process... so i have used file adapter sync read operation.
    How can we get the file name with out payload using sync read.
    For normal read (Inbound Spec)we have UseHeaders="true" property.
    Is there any property for sync read to read the file name.
    Please help me
    Regards
    PavanKumar.M
    Edited by: [email protected] on Oct 27, 2009 11:23 PM

    Hi Eric,
    The info in the link provided by you is for a normal read.
    I need to read he file name using Sync read operation.
    Regards
    PavanKumar.M

  • How to get file name and set it as static text in a dialog

    Hi,
    I m new to InDesign Programming.
    I have a menu that creates a dialog with different controls in it.
    The dialog will appear only if there is an open file. I need to display the name of the open file as a static text in the dialog. I know to get the name of the current file but don't know how to pass this each time the dialog is opened.
    Can someone help me in doing this?
    I m using InDesign CS3 in MAC OS.
    Thank You.

    those are the methods, but you can't use getCharacterEncoding(), actually, cuz it seems it's not necessarily filled in.. or at least that might be on some servers only, like Tomcat 4. As for encodings, you need to do a search for character encoding names and use the appropriate one.

  • How to get file name on the base of extension

    hi
    reply me
    how to get the filename on the base of extension from the
    current directory......
    for example
    i create file with the "igg" extension and save in the folder
    where the exe file of director save....
    i want when exe run then exe file read filename of the
    define( "igg" ) extension with out path just name of the file with
    igg extension
    tel me how
    regards
    farhana khan

    Here's a solution that requires no xtras:
    on GetFilesWithExtension(aFolderPath, aExtension)
    -- INPUT: <aFolderPath> should be a valid string
    folder path
    -- <aExtension> may be a string file extension,
    without the
    -- dot. For example: "txt" or "igg"
    -- OUTPUT: Returns an error symbol or a linear list of file
    names
    -- in the given folder. If an extension is given, only
    -- files with the given extension will be listed. If not,
    -- all files and folders will be listed.
    vFileList = []
    if not stringP(aFolderPath) then
    return #stringPathExpected
    end if
    vIgnoreExtension = not stringP(aExtension)
    vDelimiter = the itemDelimiter
    the itemDelimiter = "."
    n = 0
    repeat while TRUE
    n = n + 1
    vFileName = getNthFileNameInFolder(aFolderPath, n)
    if vFileName = "" then
    exit repeat
    end if
    if vIgnoreExtension then
    vFileList.append(vFileName)
    else if the last item of vFileName = aExtension then
    vFileList.append(vFileName)
    end if
    end repeat
    the itemDelimiter = vDelimiter
    return vFileList
    end GetFilesWithExtension
    You can also use
    Buddy API's baFileList,
    which allows you to do wildcard searching.

  • How to get File name in Proxy program

    Hi,
    According to my business scenario, one XML file name comes from Legacy system and stores in a predefined directory. Now XI has to pick up that XML file and needs to call BAPI's which in turn updates the Target system ( SAP Tables).
    Now my problem is , XML File name is a combination of three fileds those are DATE , OBJECTKEY AND WORKFLOWNAME.
    Ex : YYYYMMDD_1234565789_WORKFLOWNAME.XML
         DATE_OBJECTKEY_WORKFLOWNAME.XML
    In proxy i need to get the file name and split into three fields ( those are DATE , OBJECTKEY AND WORKFLOWNAME ) which needs to send as import parameters in BAPI's.
    So please let me know from anyone in this group how to get the file name in the proxy program.
    Thanks & Regards
    K. naveen Kumar

    Hi,
    have a look at my new weblog:
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    to see how you can access filename
    Regards,
    michal

  • How to specify file names for the generated code in wscompile

    Hi,
    We want to follow a certain file naming conventions for the artifacts generated by wscompile.
    How is it possible to set the name for the service interface file, service implementation file etc....
    This is possible in AXIS ant task Wsdl2Java. How do we do it for wscompile.
    thanx

    Thanks Chris and c. Under Description I'm presented with three Names for the profile: ASCII, UniCode and Mac Script. ASCII and Mac Script are the same name for the profile, with nothing being in the UniCode Name box. Which do I change -- both?
    Am I going to screw things up in Photoshop if I change these names to something I can comprehend? Looks like I may just have to make a sticky-note list of the cryptic profile names with my own descriptive name as a reference. Thanks.

  • How to get File name in Java Callout

    Hi,
    We are receiving EDI files with random file names through SFTP listening channel. How can we get the file name in the java callout.
    ~Ismail M

    You can try to find it out under CalloutMessage.
    CalloutMessage.getParameters().getProperty("filename")
    Thanks,
    Kathar

  • How to get file names of processes

    i am writing an application engine for monitoring ps jobs and processes i want to send an email to support group with log file if any process runs to error. Can anybody tell me how to get the log/trace files generated for each process. i tried many ways but did not get any clue would greatly appreciate for giving me information.
    thanks
    shiv

    Yes man it is possible, follow these steps if you want to automate process monitoring:
    1. Create a view for retrieving all the processes which are errored in a specific time for example 180 minutes. You can use all the following record for various information about a process or job
    PSPRCSRQST,PSOPRDEFN, PS_PRCSDEFN, PSPRCSPRFL, XLATTABLE_VW
    2. Create a table to store the process instance which was last monitored
    3. In application engine access the view which you have created in step 1, this view will give you all the processes which got errored out.
    4. In application engine use SendMail function to send an email with the process instance details which are errored out.
    5. After reading last row from the view update the table which you created in step 2 with the process instance you have read in last.
    This design should be able to send an email to support group if the process is errored out.
    Jayaprakash Tedla
    Sr. Architect - PeopleSoft

Maybe you are looking for

  • Creation of Server Proxy for  Message interface with External Defination

    Dear All, I am getting a problem while generating a server proxy for the inbound interface . The request message used in the inbound interface is a external definition which is uploaded using a XSD file. The XSD file was supplied by a third party whi

  • Kopete problem after upgrading KDE

    Hi everybody! I've recently upgraded KDE (last week, from 4.5.3 to 4.5.4) and now I have problems with Kopete, my IM client. Whenever I try to open a chat window I get an error msgbox saying that there has been and error while creating the window and

  • Place a carriage return in the field separator of an iChart

    In the Data Mapping of an iChart, the Field Separator is a good tool to obviously separate data.  The problem I see is the two fields and the separator are on one line.  How can I place a carriage return to place the two fields on separator lines?

  • How to save a png with a straight or fat alpha?

    Long story short, work in broadcast and a new piece of gear prefers png files.  I know how to save png's with a transparency, that's not the problem.  What I don't know how to do or if it's possible is to save them with a straight or fat alpha.  Righ

  • RH8, AIR Help - Any way to increase padding in right pane?

    Hi all, My client wants to try the AIR Help format for the next release of their product. They currently distribute it as a .chm. The one pesky issue I'm running into after upgrading to RH8 and generating the AIR Help is that when topics are displaye