Peformance Turning for File Download / Upload with Enabled SharePoint Audit

Greetings all, may I ask your help for Peformance Issues?
Background:
I tried to create a ASP.NET Web Page to download/upload/list SharePoint file and deployed to IIS website in same application server (will NOT use web part as some users are NOT allowed to direct access confidential workspace)
Besides, for Audit Log record purpose, the page will impersonate (without password) the logged in user:
SPUserToken userToken = web.AllUsers[user].UserToken;
SPSite s = new SPSite(siteStr, userToken);
For File Listing, the web service can provide fast response, and we are using service A/C for connection (as no auting for listing, but require audit for file download upload)
Several implemeation options tested for File Downloiad / Upload, but issues occured and finding listed below:
Issues
1) SharePoint Object Model
When I open Site (using new SPSite), it's too slow to respond. (under 1s for all operations, but require 10~50s for open SPSIte. e.g.
using(SPSite s = new SPSite(siteStr) //50s
How can I download/upload file without open SPSite object (using SharePoint object model, but user token should be kept to allow SHarePoint identifiy user actions. e.g. Updated by Tom, NOT system administrator)?
2) SharePoint default web service
For file download, I tried to use SharePoint Web Service for download file, it's quick but how can SharePoint record the audit log to downloaded user, and not service A/C? ( e.g. View by Tom, NOT system administrator)
With Windows SSO solution, please note system should NOT prompt to ask user password for use impersonation
3) HTTP Request API (for file download)
As mentioned in point 2, if the system cannot get password from user, SharePoint also recorded service A/C in audit log... ><
Thank you for your kine attention.
.NET Beginner 3.5

Thank you for prompt response, please find my reply with Underline:
Hi,
Maybe I'm not quite clear about the architecture you have now.
Is your asp.net application deployed in separate IIS site but in the same physical server as SharePoint?
Yes
"we are using service A/C for connection", can you please explain the 'A/C'?
Domain User, Local Admin and also SharePoint Service Admin A/C
Opening SPSite is relatively slower but shouldn't take 50 sec. However it depends on your server hardware configuration. You should meet the minimum hardware requirements for SharePoint.
Assigned double resources based on minimum hardware requirements.
For details, 50s is the load test result. But for other SharePoint operation, it takes around/under 3s reponse time.
Are you using SharePoint Audit log? Exactly If so then why don't you just put the hyperlink to the documents in your asp.net page. User maybe have to login once in SharePoint site but
it depends on your security architecture. For example if both of your sites in local intranet and you are using windows integrated authentication, SSO will work automatically  User is NOT allowed
to access SharePoint site/server (not implemented for sepreate server yet, as performance issues occured for
separate site in same server)  directly from Internet, the
middle server with web interface created for user request.
Whatever I understands gives me the feeling that you download the file using HTTPWebRequest C# class. However regarding security it depends on how authentication is setup in asp.net web site and in sharepoint. If both site uses windows integrated security
and they are in the same server, you can use the following code snippet:
using (WebClient webClient = new WebClient())
webClient.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
webClient.DownloadFile("file ur in sharepoint", "download directory");
Thanks, will try and reply later
But still, as I've mentioned, not quite clear about the whole architecture.
A) Request Handling
1) User use browser to request file listing and/or download file (hereafter called: File Download Request) from custom ASP.NET page (Let's say In Server 1, IIS 1)
2) ASP.NET page  or File Handler ashx (Server 1, IIS 1) call custom web service, SharePoint deault/OOTB web service or using SharePoint Object Model to access SharePoint Document Library (in Server 1,
IIS 2)
3) Both SharePoint and IIS Web Site
(Server 1, IIS 1 & IIS2) using the same service A/C
4) The web service , File Handler return file obeject to IIS1
5) IIS 1 reply File Download Request to user
B) Application Architecture (In testing environment)
1) no load balancing
2) 1 DB server (Server 2)
3) 1 Application Server (with IIS 1 - ASP.NET, IIS 2, SharePoint Web Site with default SharePoint Web Service, IIS 3 SharePoint Admin Site & IIS 4 Custom SharePoint Web Service)
4) Sepreate AD Server (Server 3)
Thanks,
Sohel Rana
http://ranaictiu-technicalblog.blogspot.com
.NET Beginner 3.5

Similar Messages

  • Problems with signed Applet for File Download under JRE 1.4 (works with 1.3

    Dear all,
    i encountered a very strange behaviour with JRE 1.4x. A signed applet used for file download worked on all platforms (Windows NT, 2000 and XP wth/wthout SP...) until I installed JRE 1.4.x (1.4.1 or 1.4.2)
    I get an EOFException when downloading binary files (for ASCII it works fine) when trying to readByte() from a DataInputStream. But not immideately, but after x bytes in the while-loop. Security is fine (I know there have been changes to that in jre 1.4, the applet itself can be started an runs with ASCII files for transfer)
    Does anyone know, what has changed in jre1.4.
    As I said, it works fine under jre 1.3.x
    The relevant code is below: byte bt = dis.readByte(); causes the error
    try{
    // Get URL from Server
    URL uFile = new URL(sFilename);
    sThisURLFile = uFile.getFile();
    Integer inte = new Integer(i);
    //open input stream for the file on server
    DataInputStream dis = new DataInputStream(new BufferedInputStream
    (uFile.openConnection().getInputStream()));
    //open output stream for the file on local drive
    String sFilenameOnly = sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1);
    int iDotPos = sFilenameOnly.lastIndexOf(".");
    String sExt;
    if (iDotPos > 0) {
    sExt= sFilenameOnly.substring(iDotPos);
    } else {
    sExt = "";
    File fileOut = new File(sDownloadDir + sThisURLFile.substring(sThisURLFile.lastIndexOf('/')+1) );
    DataOutputStream dos = new DataOutputStream(new
    BufferedOutputStream(new FileOutputStream(fileOut)));
    //read one byte from input stream, and write that byte to output stream
    long nByte = 0;
    int iCnt = 0;
    iFilesizeDone ++;
    while (nByte < iFilesize){
    String sErrPs = new String();
    try{
    sErrPs = "00";
    byte bt = dis.readByte();
    sErrPs = "01";
    dos.writeByte(bt);
    } catch (EOFException ee)
    System.err.println("internal EOFException: " + ee.getMessage());
    System.out.println("Error Filesize is " nByte " of " iFilesize "---" + sErrPs);
    break;
    nByte++;
    iFilesizeDone ++;
    iCnt ++;
    if(iCnt >= 10240) {
    ShowProgress(nByte, iFilesize, iFilesizeDone, iFilesizeTotal); // repaint does not work during init-procedure
    iCnt = 0;
    line = "Progress: Total: " + ((iFilesizeDone*100)/iFilesizeTotal) + " perc, " + iFilesizeTotal/1024 +" kbytes" ;
    labLine.setText(line);
    //dos.flush(); // improves Client performance (Agent-Call!)
    dis.close();
    dos.close();
    }// End try
    catch (EOFException ee)
    System.err.println("EOFException: " + ee.getMessage()e);
    catch (SecurityException se)
    System.err.println("SecurityException: " + se.getMessage());
    catch (IOException ioe)
    System.err.println("IOException: " + ioe.getMessage());

    perhaps they've changed something with the file blocking.
    btw, you should try to use something like this
    DataInputStream dis = new DataInputStream(is);
    byte[] buffer=new byte[8192];
    int numBytesRead;
    while ( dis.available()>0 ) {
         numBytesRead = dis.read(buffer);
    }               

  • JSF error message: Automatic prompting for file download

    This is a weird problem. I have a JSF application wherin I popup a new window on a submit button.
    The window opens a test.jsf page that redirects the output to a servlet1.
    Servlet then based on some parameters does a sendRedirectI() to different servlets out of context.
    Now the issue is that when the output is redirected to out of context servlet, that returns a file download.
    If in IE browser, if one does not do a setting of "Automatic prompting for file download", this window that I had opened on submit buttton vanishes in a jiffy. If the IE setting is done, it shows the file download correctly.
    I would want to show the user some kind of message by which he/she understands that this IE setting has to be done.
    I have tried several ways:
    1. Javascript: window.onbeforeunload on the test.jsf so that when the window unloads i can show some message. But since test.jsf forwards to servlet1, the html page generated does not show my script.
    2. I also tried checking if some windows registry can help me understand the setting.
    3. I tried writing in response object the javascript and then redirecting it to servlet out of context. But I guess sendRedirect() does a new request, so this did not help.
    Can anyone help? I am not sure if I am able to explain my problem correctly.
    Yani

    Here is the result.I used your code and it worked fine with IE setting Enabled. But when I tried to access the download servlet after opening a new window, it doesnt download the file.

  • Any way to set up iWeb pages for file download / sharing?

    I have been using .Mac Homepage to set up several web pages to share audio files with my clients. I have been able to set up a different web page for each client, each with their own password, with files there for them to download.
    Is there a way to duplicate this using iWeb now that .mac homepage sites are going away? I don't want the audio to stream, I just want to make the files available for downloading, and don't see any page templates in iWeb '08 for file downloading.
    I know that I can use mobileme's new file sharing feature to email links to individual files, but this doesn't work as well as having all the files downloadable on one or more web pages.

    If you have all of the sites in one domain file you should be able to upload only the changed pages but it's been a while since I used 08 so don't remember. You can move each site into its own domain file so that only that site is edited and published. And if you're publishing directly to mobile me only the edited files should be uploaded.
    I use iWebSites to manage over 75 individual sites.. It lets me create multiple sites and multiple domain files.
    If you have multiple sites in one domain file here's the workflow I used to split them into individual site files with iWebSites. Be sure to make a backup copy of your original Domain.sites files before starting the splitting process and move it to another location on your HD until you're satisfied the separation process is completed and what you want.
    This lets me edit several sites and only republish the one I want. Make sure you're running the lastest version of iWeb, 2.0.4 I believe.
    An example of files set up for immediate download is Toad's Cellar. Each linked is linked to a zipped file which downloads when clicked on. The site could be password protected if so desired.
    OT

  • Automatic prompting for file download

    I am using a File Download Servlet. Theres a setting in IE under Securiy Settings --> Downloads--->Automatic Prompting for File Downloads.If I have this disabled, I am able to download the file.If its enabled, I am unable to download the file successfully. Anyone have faced this problem before?

    Here is the result.I used your code and it worked fine with IE setting Enabled. But when I tried to access the download servlet after opening a new window, it doesnt download the file.

  • Java WebDynpro's and IE security settings for file download

    We have a EP 7.0 SP13 environment on which we have deployed a number of own developed java webdynpro's. In some of these webdynpro's we provide the file download functionality. The portal and webdynpro's are used by both internal personnel and external customers.
    On the other hand the default Internet security settings for Internet Explorer, disable "Automatic prompting for file downloads".
    When a user, with these default security settings active, tries to use our webdynpro's file download functionality, the screen seems to refreshes but no file download starts. When (s)he retries, the session runs for some minutes and gives following error message:
    "com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_20 failed to acquire exclusive lock on client session ClientSession".
    This behavior is explained in SAPNote 1234847. Webdynpro provides a single-thread module, meaning a user session is blocked for the during of the request. And because the previous file download isn't yet completed the new try can't start.
    Issue now, although the users IE settings allow file downloads and don't block pop up's, he can't download the file and even isn't made aware of the cause of the failure.
    How can we avoid this issue, without having to communicate the
    application requires specific browser settings?

    Welcome to the Apple Support Communities
    See > http://support.apple.com/kb/HT5290
    You can install the program using different ways:
    1. Right-click the application installer and choose Open.
    2. Go to System Preferences > Security and Privacy and select Anywhere in Allow applications downloaded from

  • Drop-down Menu to Open URL for File Download

    I am using Adobe Captivate 5.5 and was wondering if it is possible to create a drop-down menu that can be used to open different URLs for file downloads, kind of like the Attachments button Presenter has. Captivate seems to have a dropdown widget available but I can't tell if this would work for this purpose.

    Hi Theo
    You can use any composition to create a menu with setting for show target on rollover and then link targets to specific pages.
    Adobe Muse CC 7.0 Tutorial | Beautiful Graphic Navigation - YouTube
    Thanks,
    Sanjit

  • File download interferes with Quick Time

    Usually, when I download from a website a popup window appears with the option to open, run, and cancel. The title of the window is “File Download – Security Warning”.
    After installing Quick Time, when I try to download from any website, the quick time window appears instead of the Utility window by the WINDOW operating system.I would prefer the Window utility to popup, is there any way I can install quick time in such a way so that quick time window does not pop up for file download.
      Windows XP  

    Hi,
    A tiff file is a picture file. FInd a tiff file on your computer and clik it with the right mouse button. From the list choose the option "open with". You wuill get a few option on which to open the file with, choose something like "Paint" and make sure to select the thick box to always use this program to open these files. From Paint you should have no problem printing.
    Say "Thanks" by clicking the Kudos Star in the post that helped you.
    Although I work for HP my posts and replies are my own
    Please mark the post that solves your problem as "Accepted Solution"

  • Adding a new layout for DME for file download

    Hi All,
    How do i add a new layout for file download in DME?
    Thanks
    William Wilstroth

    This problem is solved.
    Need to enhanced the T042O table.

  • Duplicates.  I use iTunes match.  When I run exact duplicates, I get duplicates that say uploaded for one and uploaded with a cloud for the other.  Which one do I delete?

    Duplicates.  I use iTunes match.  Two questions:
    When I run exact duplicates on the library on my Mac Air, I get duplicates that say uploaded for one and uploaded with a cloud for the other.  Which one do I delete?
    Some of the duplicates say matched and matched with a cloud.  Same question - which one should I delete?

    I'm not sure I understand the question.
    First I would update your iTunes match.  iTunes match will tell you what is duplicates and then you can just delete them from the library. 
    Second, the course in a situation like this is to delete ONE duplicate and see what happens.  Make sure you have that song backed up somewhere just incase it deletes it completely.  But usually I'd delete one and then see if it deletes both or just the one you pressed. 
    Thirdly, update iTunes match.  It usually does a good job of locating actual duplicates.

  • Help with HttpClient for file download

    I am writing a class to download files from a website.
    The site gave me a user name and password for login
    I need to write codes to login automatically using the userName and password the site gave me.
    Please I need some help on how to do this.
    Thanks
    Cypray

    The following in google returns a number of links that look like it discusses this. I know as well that the user/pwd issue has been discussed on this site before.
    java http "file download"

  • CommandButton and commandLink behaving differently for file download

    Hello there,
    Hopefully someone can help - I have looked through the existing queries and can't just find what I'm after.
    I have a main record with asociated files - the files are uploaded through my web app and are downloaded from the same page that lists the files in a dataTable. I have a series of commandLinks that display the file names - a user selects the file and it downloads.
    The problem I have is that when a user downloads a file then immediately trys to upload another, they are prompted to download the file that they have already previously downloaded. If however I replace the commandLinks for commandButtons the application behaves correctly.
    I have seen an associated link that mentions similar behaviour (http://blogs.sun.com/tor/entry/creating_downloadable_files), however I do not want to use the command buttons in this manner, and I use an actionListener rather than an action so I may retrieve information from the list of dynamically created files. I am not receiving any errors, just the strange behaviour with commandLinks.
    My code is as follows:
    public void downloadFile(ActionEvent ev) {
    UIData fileList = findParentHtmlDataTable(ev.getComponent());
    AssociatedFile associatedFile = (AssociatedFile) fileList.getRowData();
    String downloadPath = "download path retrieved here...";
    try {
    byte[] fileData = InternalUtil.readFile(downloadPath);
    HttpServletResponse response =
    (HttpServletResponse) getFacesContext().getExternalContext().getResponse();
    response.setHeader("Content-disposition", "attachment; filename=\"" +
    associatedFile.getName() +
    response.setContentLength(fileData.length);
    response.setContentType(associatedFile.getContentType());
    ServletOutputStream out = response.getOutputStream();
    out.write(fileData);
    getFacesContext().getApplication().getStateManager().saveSerializedView(getFacesContext());
    getFacesContext().responseComplete();
    } catch (FileSystemException e) {
    getFacesContext().addMessage("null", new FacesMessage("Error downloading file: " +
    e.getMessage()));
    } catch (IOException e) {
    getFacesContext().addMessage("null", new FacesMessage("Error downloading file: " +
    e.getMessage()));
    Any help would be greatly appreciated!
    Thanks in anticipation, Carl

    Which JSF version are you using? Try upgrading to newer version if needed. http://javaserverfaces.dev.java.net

  • DownloadServlet or alternative method for file download

    I have searched the forums for this topic and have seen one other posting from someone having the same problem (with no response). I can not get the oracle.jsp.webutil.fileaccess.DownloadServlet to fully function. Using the file access example code that is installed with iAS and following the instructions in the manual "Oracle Application Server Containers for J2EE JSP Tag Libraries and Utilities Reference 10g (9.0.4)" I can get the file upload to work just fine (both to a file and to the database). However with the file download it stops short of working. It will access the DownloadServlet and list the files that have been uploaded, but when you try to follow the link that it creates you get a "400 Bad Request"
    If you look at the URL it creates I see what I think is a problem
    Here is a clip of code from dbBeanDownloadExample.jsp that creates the URL
    The following files were found:
    <% Enumeration fileNames = dbean.getFileNames();
    while (fileNames.hasMoreElements()) {
    String name = (String)fileNames.nextElement();
    %>
    <br><a href="<%= servletPath + name +
        ?"+FileAccessUtil.SRCTYPE_PARAM + "=" + dbean.getSourceType() +
    "&"+FileAccessUtil.TABLE_PARAM + "=" + dbean.getTable() +
    "&"+FileAccessUtil.PREFIX_COL_PARAM + "=" + dbean.getPrefixColumn() +
    "&"+FileAccessUtil.DATA_COL_PARAM + "=" + dbean.getDataColumn() +
    "&"+FileAccessUtil.FNAME_COL_PARAM + "=" + dbean.getFileNameColumn() +
    "&"+FileAccessUtil.FILETYPE_PARAM + "=" + dbean.getFileType() %> ">
    <%= name %></a>
    <% } %>
    and here is one of the URLs
    http://iasserver.here.com:7779/ojspdemos/servlet/download/beanexample\fields.txt?srcType=database&fileType=binary&table=fileaccess&prefixCol=fileprefix&fileNameCol=filename&dataCol=data
    The problem I see is the fileprefix (from the upload) "beanexample" and the filename "fields.txt" is appended to the end of the servlet "download", while the rest of the parameters to the DownloadServlet are passed in the proper manner "srcType=database". I have been unable to find any documentation on the DownloadServlet so I don't know if there are setters for the fileprefix or the filename.
    This example code has been out for sometime, I know it was with iAS 9.0.2. Has any one been successful implementing the download of a file from the database using the oracle.jsp.webutil.fileaccess.HttpDownloadBean or the tag?
    Certainly Oracle must test this stuff before they release it. At some point I think this must have work.

    Larry, the DownloadServlet certainly worked at some point of time as ensured by the automated tests. It should work all the time, I believe, unless......
    The problem I see is the fileprefix (from the upload)
    "beanexample" and the filename "fields.txt" is appended to > the end of the servlet "download", while the rest of the
    parameters to the DownloadServlet are passed in the proper > manner "srcType=database". I have been unable to find any
    documentation on the DownloadServlet so I don't know if
    there are setters for the fileprefix or the filename.A nice observation. That is the root cause of the problem, I believe. Actually, the documentation is right there in the example dbBeanDownloadExample.jsp. You should use
      String name = (String)fileNames.nextElement()).replace('\\','/');
    as in the example instead of
      String name = (String)fileNames.nextElement();
    Well, I will check if this point of changing '\' to '/' have been made explicitly in the documentation. That kind s of tiny point is sometimes really a killer.
    Hope this helps.

  • Importan Topic. Bigger File Dowload/Upload with resume feature

    Hi All
    How do I download/upload bigger files(like 10 GB) using servlet. For example if I try upload 10 GB file and if I got disconnected around 1GB, I would like to know how do I resume the upload from where I got disconnected. Is anybody got sample code for upload/dowload with Resume feature.
    Thanks
    Dhamo

    Where do you want to upload it to?
    A ftp server?
    http://www.javaworld.com/javaworld/jw-04-2003/jw-0404-ftp.html

  • ECC6.0 code download/upload with unicode

    Hi, we have a need for on-going parallel code maintenance of 2 separate development instances.  In end effect we need to manually synchronize two development instances for a period of time.  We have before in the past used custom programs and some of the standard SAP utilities provided.  However I'd be surprised if there isn't a more comprehensive utility supplied by SAP by now for this purpose.  By now I mean with release ECC6.0 with unicode active.  Does anyone out there know of a utility that can download any program(WebDynpro, BSP, R/3 dynpro, report, program, function module, class, etc with all relevant textpools and documentation) to a file so that it can be uploaded in its entirety without great effort?  We currently have a custom program which downloads/uploads ABAP source and text but it only works with standard executable r/3 programs.
    Thanks in advance,
    Kevin

    Here is the link for the google code site where you can download Saplink.
    http://code.google.com/p/saplink/
    Here is the direct link to the saplink installation zip file.  There should be some instructions within.
    http://saplink.googlecode.com/files/SAPlink_install-0.1.3.zip
    Once you have the base installation installed, you can then start adding plugins for other development objects.  The plugins have their own site.
    http://code.google.com/p/saplink/wiki/pluginList
    REgards,
    Rich Heilman

Maybe you are looking for

  • IPhone5 Preorder Family Members Upgrade

    Hi all, As everyone knows the iPhone 5 is now available for pre-order, only problem is I have one more year till I can upgrade for the price of $200 with my carrier AT&T.  However, a family member of mine has an upgrade and said I could use theirs, s

  • Edited Images Do Not Refresh

    When I edit an image in an external program (PS, Illustrator), Dreamweaver doesn't show the changes. It insists that no changes have been made. Refresh doesn't help, nor does using any of those idiotic internal image editing buttons in DW. (Half of t

  • Why wont lightroom open?

    I purchased lightroom from office depot which was on a card with serial number. I was able to download it and used it several times. After 2 weeks, it would not open.  Is the serial number only to be used a few times?   I also downloaded some presets

  • Customer communication date for items on allocation  hold

    When a product is on allocation hold, the order confirmation to the customer, which is communicated via email or fax, is showing a delivery date.  This delivery date is usually wrong since the allocation hold is overriding the schedule line. what is

  • How to set layer color property via script?

    I'm looking for a way to set a layer's UI color property via script (see attached). Any help would be greatly appreciated!