SQL FileStream Access to Stored Document

I can upload store files, but can not retrieve files stored in SQL FileStream from a desktop PC. But I can retrieve the document from the IIS 7.0 server. The SQL server is on a different server.

I ran found out that SQL does opens and reads the SQL filestream stored document but returns Access Denied to IIS.  The program that retrieves the data is a class library that other programmers use in their program to publish the document.  I am
not sure if the problem is the my code or an active directory security issue.
Calls to retrieving the document as a byte array.  Then loads the byte array to a structured data array.
        private List<string> img = new List<string>() {"JPG", "GIF", "IMG", "BMP", "PIC"};      //define specific possible image type files
       /// <summary>
        /// This will retreive the blob as a Memory Stream 
        /// </summary>
        /// <param name="ID">Optional: ID Index reference of a specified Blob file. If ID is 0 the complete list is returned</param>
        /// <returns>Return type is Memory Stream</returns>
        private byte[] data;
        private blobTable rtnBlob;
        public blobTable get_Blob(int ID = 0)          // System.Drawing.Image get_Blob(int ID=0)
                    dbTble = "FileSto";
                    tblCol = "fStoID";
                    data = go_get_sqlStream(dRow);
                dbRow = dRow;
            dSet.Clear();
            dTable.Clear();
            IEnumerable<string> dType = from picImg in img
                                            where picImg == dbRow["docType"].ToString()
                                            select picImg;
            rtnBlob.DocByte = data;
            return rtnBlob;
        private byte[] byteStream=null;
        private byte[] go_get_sqlStream(DataRow refRow)
            object sqlPath;
            string sqlFileLoc = null;
            SqlTransaction sqlTrans;
            sqlcmd = new SqlCommand();
            sqlcn=GetConnected(sqlsvr);
            sqlcmd.Connection = sqlcn;
            sqlcn.Open();
            string sqltxt = "SELECT DocFile.PathName() FROM " + dbTble + " WHERE DocID = '" + refRow["StoID"] + "'";
            sqlcmd.CommandText = sqltxt;
            sqlPath = sqlcmd.ExecuteScalar();
            if (DBNull.Value != sqlPath)
                sqlFileLoc = (string)sqlPath;
            else
                throw new System.Exception("DocFile.PathName() failed");
            sqlTrans = sqlcn.BeginTransaction("mainTrans");
            sqlcmd.Transaction=sqlTrans;
            sqlcmd.CommandText="SELECT GET_FILESTREAM_TRANSACTION_CONTEXT()";
            sqlPath = sqlcmd.ExecuteScalar();
            byteStream = (byte[])sqlPath;
            sqlStream = new System.Data.SqlTypes.SqlFileStream(sqlFileLoc,byteStream, System.IO.FileAccess.ReadWrite);
            System.IO.StreamReader RSteam = new System.IO.StreamReader(sqlStream);
            string sqlData = RSteam.ReadToEnd();
            sqlStream.Seek(0, System.IO.SeekOrigin.Begin);
            byteBlob = new byte[sqlStream.Length - 1];
            sqlStream.Read(byteBlob, 0, byteBlob.Length);
            sqlStream.Close();
            sqlcmd.Transaction.Commit();
            sqlcn.Close();
            byteStream = byteBlob;
            sqlStream.Dispose();
            return byteStream;
Thanks, 

Similar Messages

  • How do you access iCloud (non-Pages) stored documents on iCloud

    How does one access iCloud (non-Pages) stored documents on iCloud? Only iWork shows up.

    iCloud does not provide general file storage: only iWork docucuments (at the moment) will upload to iCloud for access by other devices/computers. There aren't any other documents stored up there.

  • How to access my stored files

    How to access my stored files

    You can only transfer contents back, if they are associated with a certain app that takes up documents. If you go to the sync pane for apps and check the lower list of apps, clicking them one by one and check if contents you need are showing on the right hand side.
    Other contants cannot be transferred back, especially synced pictures cannot be transferred back to the computer.

  • Restrict access to bw_metadata documents in WAD NW04S

    Dear All,
    We are deploying a new reporting and analysis application on NW04S BI.
    In this application we set in a toolbar an access to some help documentation that are stored in KM as bw_metadata documents for the concerned web template (command OPEN_DIALOG_DLG_DOC_BROWSER).
    But the problem is that every one is able to create, change and delete these documents !
    I would like to restrict the access to these documents only in read for everyone and change for some power users.
    In the permissions in KM, i cannot change access on this repository.
    Did someone have an idea on how to change these permissions/authorizions ?
    Thanks in advance for your suggestions.
    Fred.

    Fred,
    sorry about that did not see the KM part...
    help.sap.com still talks about setting up the BI document repository on the portal and not about KM when I did a search for OPEN_DIALOG_DLG_DOC_BROWSER ,
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/17348cfa923614e10000000a422035/content.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0901c9bb-0601-0010-49ab-c1770c527673
    The WEB API does not seem to make a distinction betweek KM and the BDS . and not much given on single document..... maybe the single document is worth a try....
    Arun
    Hope it helps...
    P.S BTW is the WEB API for 7.0 documented anywhere ? not able to find the same .. keep running into the 3.x version ....

  • Valid period for stored documents (Archive Link)

    Hello,
    Can someone please confirm if the stored documents within Archive Link can be retrieved after more than 10 years or is there an expire date setting?
    Thanks.

    SAP does not work like "Mission Impossible", that a document disappears itself after a certain time.
    If you archive documents, then it is still up to you, when you want to dispose this archive.
    E.g. you have to keep financial data for 10 years as requested by law.
    But you want keep your database small and want have a good performance.
    So you decide to archive everything what is older than e.g. 2 years.
    The older documents are written to an archive file and deleted from the table spaces.
    The archive can stay in the SAP file system (quickest access) or in an external archive system like IXOS.
    You have to make sure that you keep this archive with data older than 2 years for another 8 year to comply with the legal requirement.
    If the 10 years have past, then you archive the archive information (this has the info where your archive is located)  itself  and remove the indexes to the archived documents that are older than 10 years.
    Then you take the disk from the IXOS system and destroy it.
    If you dont archive the archive infos (SARA for BC_ARCHIVE) and dont destroy the archive files then you may be able to access the data far beyond the 10 years.

  • Storing documents in the repository?

    There was a way to do this in release one, but I haven't come across it yet in 9iAS release two (9.0.2):
    Does anyone know of existing documentation that explains how to store common documents in the metadata repository; how to control access to them; and how to link to them via URL? Or a step-by-step method? Thanks!
    Mike

    Not sure what you mean. Do you mean storing documents via the browser user interface? via APIs?
    If the former there is lots of documentation on adding content via the browser-based wizards. If you're looking for APIs, we plan to release these with the upcoming 9.0.2.6 upgrade release.
    In 9.0.2 you can also use WebDAV (Web Folders) to upload documents to the repository.
    Regards,
    Jerry
    PortalPM

  • Disabling Secondary Popup When Accessing Office 2003 Documents Through KM

    Hi,
    we have the old problem with "Disabling Secondary Popup When Accessing Office 2003 Documents Through KM" which was topic of a weblog by John Mittendof already.
    For us it was solved when using Windows-integrated authentication without changing the registry as described.
    This works with Office2003 SP1. With SP2 the popup appears again.
    Does anyone have the same problem???
    The disadvantage with the registry solution is, that the files will be stored in the temporary internetfiles which leads to a message when opening a second time (in the sense of: document already open by "myself" - open writeprotected?).
    Best Regards
    Helge Stührmann

    Please Try this: (You should change all these settings or you'll get other errors)
    Go to Content Management ® Global Services ® URL Generator Service.
    Make the following changes:
    &#9679;      a) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs in the parameters Image Path, Viewer, XML Forms CSS URL, and Content Access Path with /irj/go/km/docs
    The entry in the Image Path parameter must look as follows: /irj/go/km/docs/etc/public/mimes/images
    &#9679;      b) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.uidetails in the parameters Resource Properties Page and New Resource Properties Page with /irj/go/km/details
    &#9679;      c) Replace the prefix
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.navigation in the parameters Explorer Servlet and Navigation Servlet with /irj/go/km/navigation
    &#9679;      d) Replace
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent in the parameters Highlighted Content with /irj/go/km/highlightedcontent
    &#9679;      e) Replace
    /irj/servlet/prt/portal/prtroot/com.sap.km.cm.basicsearch in the parameter Basic Search Servlet with /irj/go/km/basicsearch
    Regards, Fede

  • SapWorkDir - Stored document - 21 files download limitation

    Hi
    Sap Gui Version: 620 sp44
    Scenario: User opens stored document(Tif file stored in content server) attached to a Sap Document ID.  The Stored Document(Tif file) is downloaded to the PC SapWorkDir directory.
    Technical Limitation: I think there is a limitation of 21 Tif files that SapGui can store in the SapWorkDir.  On the 22nd tif file download the SapGui starts to overwrite the first tif file hence it goes through a 21 file cycle.  Naming convention is retained eg APRD01, APRD02… APRD21.
    Problem: If a user tries to open a previously accessed Sap Document ID Stored Document(Tif file) the SapGui does not download the tif to the SapWorkDir directory.  Instead it looks like it checks a SapGui cache and opens the Tif file it originally downloaded to SapWorkDir directory.  This Tif has obviously been overwritten because of the limitation of the 21 file download cycle.
    Does anyone have any ideas??
    Cheers

    Patched gui and resolved

  • Error...java.sql.SQLException:Access denied for user

    Hi,
    I am getting the following error message while connecting with the MySQL .(O/S :Sun OS 5.6)
    Error.....java.sql.SQLException: Invalid authorization specification: Access denied for user: 'some_user&password@localhost' (Using password: NO)
    Note that i have given all permission to the user using,
    GRANT ALL PRIVILEGES .......................
    The code i have used to connect with the database is,
    import java.io.*;
    import java.sql.*;
    class test
    public static void main(String a[])
    try
    Connection con;
    Statement stmt;
    ResultSet rs;
    Class.forName("org.gjt.mm.mysql.Driver");
    con=DriverManager.getConnection(jdbc:mysql://localhost/db_name?user=some_user&password=some_pass");
    stmt=con.createStatement();
    //do something with resultset
    catch(Exception e)
    System.out.println("Exception in second try.."+e);
    plese guide me on this problem to solve.
    Thankz,
    Bala.

    Hi friends...
    I've read the last post...
    The problem that I have is as follow....
    1. I have installed on my machine MySQL 5.0 Server running
    1.1 I have a database called "base1"
    1.2 User "root", password "works"
    1.3 I have the following sentence to connect it using JDBC
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost/base1", "root", "works");
    More notes:
    - I use the JDBC 5.0
    - My Machine is a Windows XP SP2 Pentium 3.0 512Mb
    and it connects����
    but I have this environment to develop applications, now that I want to connect to Production Environment happens the following:
    2 The Production database is mounted on a Linux Server with MySQL 3.2.
    2.1 I change the sentences as follow:
    Connection con = DriverManager.getConnection("jdbc:mysql://192.168.0.7/base1", "user", "password");
    2.3 But a message appears when I run the Java Program:
    java.sql.SQLException:Access denied for user: '[email protected]' (Using password: YES)
    2.4 As you can see it changes the IP Address...
    More notes:- I have the MySQL Query Browser and I got connection.
    - The IP that display the Error Message is my Second IP configurated on my Network Properties.
    - Server is a Pentium 4 3.0 GHz 2Gb Linux Red Hat 3.0
    I leave this case for the spider... I hope that somebady has the solution.
    What is the problem? Why the JDBC doesn't respect the IP that I wrote.

  • I saved a spreadsheet to iCloud now I can not access it.  The message I get say I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    I saved a spreadsheet to iCloud now I can not access it.  The message I get says I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    Please see this user tip:
    Need newer version of Numbers to open file

  • Error while checking in and storing document in storage category

    Dear Consultants,
    When i am trying to save a document in storage category thru tcode cv02n, its giving me error:-
    Error while checking in and storing document "c:/desktop/content.doc",
    while there is no error in csadmin and OAC0 tcode repository is in running status
    even output of
    dbmcli db_enum
    OK
    SDB     /sapdb/SDB/db                     7.6.03.09       fast    running
    SDB     /sapdb/SDB/db                     7.6.03.09       quick   offline
    SDB     /sapdb/SDB/db                     7.6.03.09       slow    offline
    SDB     /sapdb/SDB/db                     7.6.03.09       test    offline
    URL "http://192.168.2.11:1090/ContentServer/ContentServer.dll?serverInfo"
    output :-
    serverType="SAP HTTP Content Server";serverVendorId="SAP AG";serverVersion="640";serverPatch="7";serverBuild="23";pVersion="0046";serverStatus="running";serverDate="2011-12-14";serverTime="10:01:44";startUpDate="2011-12-14";startUpTime="06:36:18";lastAccessDate="2011-12-14";lastAccessTime="09:57:59";
    contRep="ZCONT_TEST";contRepStatus="data(0%) log(191655552%)";pVersion="0046";storageVersion="17";storage="SAPDB";buildLevel="1";contentStorageName="SDB";contentStorageHost="localhost";security="1";contRepDescription="test content repositry";driver="MaxDB";defaultDocProt="";
    contRep="ZDMS_C1";contRepStatus="data(0%) log(191655552%)";pVersion="0046";storageVersion="17";storage="SAPDB";buildLevel="1";contentStorageName="SDB";contentStorageHost="hpsebdev1";security="1";contRepDescription="Database storage documents";driver="MaxDB";
    Please Help regading the issue
    Regards
    Gagan Sharma
    Basis Consultant

    Hi,
    Please revisit your DMS configuration. May be something is missing out in the configuration.
    Additionally you can retry to chekin by changing the following parameter
    security = 0.
    Hope this is useful.
    Regards,
    Deepak Kori

  • Office Word 2008 crashes when trying to open a local stored document ONLY if network connection is down

    Sorry to bother you all but I have a situation I can't find a solution for:
    on a MBP 2009, running Mac OS X 10.6.8 and MS Office 2008 (up to date), if I open a local stored document AND the unit is connected to the network everything works fine.
    As soon as I switch off the network connection and I open a local stored document Word freezes and within "Force quit..." I can see that Word is no longer responding. A few minutes later OS X quits Word and that's it.
    I already checked Safe boot, removing the Microsoft plist's and reinstalling MS Office 2008 including all available updates but the situation is still the same.
    Any ideas?
    Thanks in advance
    Robert

    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account

  • How do I get access to Mobile documents admin console login with SAP HANA Cloud cockpit?

    Hi All,
    I am trying to launch SAP Mobile Documents from my trail version of SAP HANA Cloud.
    The Help link which I had followed  via link:
    https://help.hana.ondemand.com/help/frameset.htm?dc618538d97610148155d97dcd123c24.html#concept_0B49F10346C94249845EC16364FFF66D_76
    In SAP Cloud HANA Cockpit Using the link available in Authorization>Authorization Management
    I had created an user assigned to a Group, and Group has been assigned to a  Role ODP-OPERATOR,
    Next step, when I am trying to assign a token, I could not able find a token. How to get a token from here?
    My intention of creating user, group, role and token is for getting access to Mobile documents admin console.
    However I have also tried to access the mobile documents admin console via link
    https://smd-p1886950994trial.hana.ondemand.com/mcm/admin
    When I browse the above link, It shows HTTP 503 the requested service is not currently available.
    I am not sure, How to get access Mobile documents Admin page from here
    Could someone clarify on this please?
    Regards,
    Saravanan.R

    Hi,
    I have managed find an answer from this link SAP Mobile Documents on SAP HANA Cloud saying, SAP Mobile documents trial is not available in SAP HANA Cloud cockpit.
    Regards,
    Saravanan.R

  • How to restrict read access to certain document in stellent content server

    Hi,
    We are using stellent content server to store project documents. We would like to restrict access to certain confidential documents.
    Users with Read / Write permission should not be able to access but admins with RWDA permission should be able to access these confidential documents.
    Appreciate your inputs on this.
    Thanks,
    Nayana

    Without seeing your setup and environment its a bit hard..
    But...
    Make sure that user has read only access to public security group.
    You could setup an addition role with readOnly access and apply it those users.
    Or restrict there account to have Read only access.
    Remember if the user has Admin access on the Account but only readonly access on the security group then they will only have read only access on the files and visa versa.. :)
    J.
    Message was edited by:
    JRS

  • How to control access to a document library based on fields of the list?

    Hi, 
    I need to give access to a document library but the users who need permission are unknown until the form
    is submitted to the document library.  The 2 users information are in 2 fields of the form.  I created a infopath form and a workflow with it.
    I need to give the "CreatedBy" user, the person who completed and submitted the form, and the
    Requester (a data field on the form), both need access to the new document library or just to the forms they submitted.  How do I setup access for the createor and requester of the form?  These are unknown until the time of the form submission and
    it's dynamic.
    Anyway to implement this in SP?  If not what about coding for when the form is loaded.  Can
    someone point me to a sample coding for ref fields in the form when form is first loaded up?  Also, how to redirect to a access denied view in the code.
    Thank you.

    It's not easy OOTB but it can be done if you either use code or use some code someone else created.
    Have a look at this on codeplex
    https://spdactivities.codeplex.com/wikipage?title=Grant%20Permission%20on%20Item

Maybe you are looking for

  • How long should it take to install creative cloud?

    i started to install it this morning and it  was sitting for 6 hrs and it still hasn't finished or gotten half way. my internet is a little slow right now but i don't know if it should take this long?

  • The application 'Finder' unexpectedly quit while trying to restore its windows.

    Hello All.  I solicit your help and advice please.  When I started up on my Macbook Pro (v10.7.5) this morning the Finder icon was flashing along with a flashing message that states "Restore Windows.  The application 'Finder' unexpectedly quit while

  • Xperia Fan

    Hi, I am a sony device fan using multiple sony devices specially smart phone! Since 5 months I m experience some problem with my Xperia Z2 mobile handset it has suddenly stop working , sometime during the call its stopped. Earlier I thought there may

  • Tables for  BUDGET & ACTUAL - COST CENTER

    Hi I want to know what are the table in which the actual and the budget for the COST CENTER are stored.... Regards SAP4ME

  • What files can be excluded from user-managed backup in noarchivelog mode?

    what files can be excluded from user-managed backup in noarchivelog mode? control files, sqlnet.ora file, tnsnames.ora, datafiles associated with read-only tablespaces, datafiles associated with read/write tablespaces, of these, what can be excluded