Adds .ps to downloaded .ai files

Why does Safari add .ps to a downloaded .ai file?
The files end up as thisfile.ai.ps
How can I stop Safari from adding .ps to .ai files?

I couldn't find out how to post a new topic. . .Dah! Sorry. But, this is similar, perhaps. On the Yahoo site, in groups, about a week ago, instead of downloading a file by its name, Safari started downloading "securedownload," "securedownload-1," etc., sometimes followed by ".jpg" or whatever the file was, and sometimes without any file ending. I posted a message in one of the help groups. Several Mac users responded saying they were having the same problem but didn't know how to correct it. This seems to be happening only in Yahoo groups. So, perhaps this is because of a change Yahoo has made, but is there any way around it? In other words, can I get the files to download correctly, with their names and file endings?

Similar Messages

  • Add text to downloaded CSV file

    Hi.
    I'm trying to place a text at the bottom of the csv file, but I can not find the way to do it.
    What I'm trying to do is, after all rows downloaded in my csv file, I'd like to place a general comment in the next row regarding some information about the data I've downloaded.
    Is this possible?
    Thanks
    Ivo

    one of my colleagues might have a better answer for this, but one not-so-elegant way to get a message to display at the bottom of your csv output would be to manually put your own "download to csv" link on your page. have that link go to another page in your app that reports on the same query as your original report. put a region of type HTML right after your duplicate report region that displays the text you want to see in your csv output (be sure to use "No Template" for this region's template). change the report template of the second report region to "export: CSV". now when users click your manually added "download to csv" link, they'll be linked over to your other page. that page will immediately output the csv data as well as the additional line from your extra HTML region.
    hope this helps,
    raj

  • Add mp3 to iTunes, delete file from Downloads, add Comment?

    I'm trying to make a folder action that will:
    - Watch my 'Downloads' folder for downloaded .mp3 files.
    - Add those .mp3 files to iTunes, letting iTunes copy to music folder.
    - Delete the original file from the 'Downloads' folder.
    - In iTunes, append '#single' to the Comment field of added .mp3.
    So far I have the first three working, but cannot get it to append the #single part to the Comment field, here's what I have:
    property myFiletypes : {".mp3"}
    on adding folder items to this_folder after receiving added_items
    set myFinderItems to added_items
    tell application "System Events"
    set allItems to every item of myFinderItems
    end tell
    repeat with i from 1 to the count of allItems
    try
    -- get an item
    set myFinderItem to (item i of allItems as alias)
    -- check if it is a folder
    tell application "Finder" to set myItemIsFolder to (kind of myFinderItem = "Folder")
    -- if it isn't a folder...
    if myItemIsFolder is false then
    -- see if the file has the right extension
    tell application "Finder" to set myItemExtension to "." & (name extension of myFinderItem) as string
    if myFiletypes contains myItemExtension then
    set mySongName to myFinderItem as alias
    -- add track to iTunes
    tell application "iTunes"
    add mySongName
    end tell
    tell application "Finder" to delete file myFinderItem
    end if
    end if
    on error
    display dialog "Error"
    end try
    end repeat
    end adding folder items to

    Better yet, an Applescript that can be used as a folder action to watch the Downloads folder and:
    1) Open .mp3s in iTunes and append #single to track Comments, then delete original .mp3s.
    2) Open .zip and .rar archives, parse then unarchived folder for .mp3 files, add them to iTunes, append #album to track Comments, then delete original folder of .mp3s.
    2a) Bonus points if the script adds the .mp3s to itunes in descending order based on file name track numbers (track 10, track 9, track 8...).

  • How do I share a link to a file and have the other person download the file without having to add them explicitly as a member, like Dropbox does?

    With Dropbox, I right click on a file within my designated Dropbox folder and choose share Dropbox link.  This copies a unique URL that I can send to anyone to then download that file and that file only.  I do not have to add people to my access list to allow the download.
    How do I do this with Oracle Documents?  I have one off large files that I prefer not to send via email, however, I do not want to add everybody in the company as a member to my access list.

    There is an option called Public Links which allows you to do this. Select your item and click Share. This throws a pop-up dialog. On the left side of the dialog you may have 3 options - Members, Member Links, Public Links. If the Public Links option is not there, then your service administrator has disallowed them from use. The Public Links option is a controversial one in the enterprise space. DropBox's original offering had no qualms with offering public links because the content was guaranteed to be the property of the dropbox user. However, at enterprise level, the content belongs to the owning enterprise, so service administrators may elect not to allow this feature. This is down to your organisation.
    If you see the Public Links option, click on it and the right side of the popup dialog will change. You can specify:
    a name for each link you create (so you can keep track of which link is which),
    Link Permissions, only the following are available for obvious reasons - Viewer, Downloader, Contributor
    Link Expiration Date - a date after which the link will not work
    Access Code - a pass code which you can divulge to expected recipients by alternative means of your own choosing. This access code guarantees a measure of security on a link which could otherwise be used by anybody
    You can create several public links for the same item, and each of those can have the above settings, so you could have one link for downloaders and a separate link for contributors, for example. Each link can then be sent, either by copy/paste or through the email button to the right of the link. You can also modify the link using the pen icon, so you can unexpire it or reset its expiry date. You can also delete a link using the trash button next to it.
    I hope this explains the public link feature.
    Regards,
    Frank.

  • How to add a SPACE as suffix to the last field in the downloaded text file?

    Hi Experts,
    By using GUI_DOWNLOAD am saving the data(only 3 fields) in a text file on my desk top.
    fine.
    example current record1 : 010001                      354.999            26.000
    here, after 3rd field 26.000, immediately the cursor is jumping to next line in text file.
    but, wanna a SINGLE SPACE after 26.000, say 26.000+space.
    tried with CONCATENATE, OFFSETTING, but no use(may b am using incorrectly)
    so, pls. suggect me, How to add a SPACE as suffix to the last field in the downloaded text file?
    thanq

    Sorry...Typo error...Too many in the last few days -:(
    Wanted to say AFTER -:)
    Do it like this...
    FIELD1 TYPE XXX,
    FIELD2 TYPE XXX,
    FIELD3 TYPE XXX,
    SPACE(1) TYPE C,
    That way you should end with...
    26.000+SPACE
    Greetings,
    Blag.

  • Mac adds automatically a suffix when downloading a file. How to stop the Mac from doing this?

    I want to download a gps-file for my tomtom navigation system.
    These files have the suffix .itn
    When downloading, OS X transforms the file from filename.itn  to   filename.itn.txt automatically, therefore adds an ".txt", and opens the texteditor with the file.
    I just want OS X to leave the file as it ist and add or do nothing to or with it. Just put it in the download-folder.
    When hiding the suffix with apple-i, the file is no longer readable for the navi system. There ist no option to tell the mac just to do nothing; you just can select a different app. But this is not the solution.
    What can I do?
    Thanks
    Mathias

    Limnos wrote:
    I use a much older version of Safari when I do use it. I have that unchcked but when I download a file Safari just downloads it without any prompt for a file name.  What the OP needs is a way to change how Safari handles downloads so it either identifies them correctly and stops adding the wrong extenion to a file, or a way to edit the file name at download time. My old version doesn't have any apparent way to configure either of these, but I can do it in Firefox.
    What?
    The file has a name prior to downloading, Safari does not ask for one to be added at download time (neither do other browsers), once the file has been downloaded the extension can be corrected.

  • Add Ons,Internet Explorer and downloading PDF files

    There is one website where I have an issue downloading some PDF files,I do not have problems on any other website,admin at problem website gets no other complaints.
    I use Adobe Reader 11.0.08.
    I discovered that if I DISABLE the ADD ON in Internet Explorer for Adobe Reader I can easily download all content from this problem website ,If I ENABLE ( my norml operation ) the ADD ON for Adobe Reader ,the PDF download problem appears again.
    What exactly is the ADD ON doing ? I'm under the inmpression that it ties software to a website ,so when I ask for a PDF file on a website, the website looks for Adobe Reader and the PDF file opens  ,using Adobe Reader . . . if I disable the ADD ON . . . doesn't the website NOT know how to give me the PDF file . . .  yet with the ADD ON Disabled this problem website downloads the PDF file using Adobe ( it said it is using Adobe ) with no problem ?
    Why ??
    This issue happens on two differnt PC's ??

    P.Willener,
    Thanks for response.
    The website is not public ,that I have PDF download issues using Adobe Reader 11.0.08. I have no PDF download issues on any other website with PDF files.
    On this problem site I can download some files, others I can't.
    The website admin gets no other complaints from other website users.
    I discovered that on a friends new PC ,this website works good and I can download all files, no problems.
    I have an older PC ( 2008 vintage )  ,it runs Windows 7 and IE 11 , with this PC I have PDF download issues on this website only , when the problem occurs the files stop and never complete downloading,  all recent website PDF  files download OK, older files do not ,on my PC   . . . but if I DISABLE the Adobe Reader ADD ON ,ALL files download with no problem, if I ENABLE the Adobe ADD ON ,I have problems.
    My question is . . . why ?  When the ADD ON for Adobe Reader is ENABLED what is different then when the ADD ON is DISABLED ,for Adobe Reader ?
    To me ,it seems that in the ENABLED mode ,the PDF file is opening within the IE browser ,using Adobe Reader , when the ADD ON is DISABLED the PDF file is opening in the External Reader mode , using Adobe Reader am I correct on this thinking ????
    So again why would I have issues on this one website only ?  Yes there is a work around but my normal way of operating is what the Adobe Reader ADD ON ENABLED.
    Any ideas what is going on ????  If you suspect the website any thoughts on what their problem could be ????   Again they get no other complaints ,I guess they all have new PC's.
    Al

  • If I add a .mp3 - Do Visitor need QT Pro to download the file?

    This is actually the question.
    I create a page where visitors should be able, to
    1. listen direct to the file (solved this adding a flashplayer)
    2. subsuscribe to a podcast (solved with lemonz dream podcast maker) and last
    3. Download the file direct
    so, if Visitors want to do point 3. Do they need the ProVersion? Do I have to make a .zip and add this also to the side.
    Thanks Martin

    Create a link to the MP3 and tell the vistors to save the file. Add the words +Right-click to save+.
    Or create a zip file and link to it. Clicking the link will usually download the zip file. Hopefuly they know how to unzip it.
    Or ignore these solutions and just tell them to subscribe to your podcast.

  • Download File thru Text file and add password to protect text file

    Hello ABAPers,
    I have a problem regarding downloading of file in text file with password...meaning I need to protect with password the text file i created without human intervention...is it possible to ABAP? im using FM GUI_DOwnload and save it to text file.
    Please Help...Will reward points ...
    Thanks in advance.
    aVaDuDz

    Hi
    You could use OLE to integrate SAP with Excel - create files, execute macros etc. (search for DOI on SAP help), but this will only work on the presentation server, so you couldn't run it as a service in background. I suppose your e-mails are sent through the internet, hence the requirement for encryption -- or maybe your client doesn't trust its network people! For this you really should use strong encryption -- anything less, you might as well send plain text. One solution to this would be to send the email down a VPDN -- this would encrypt all traffic between source and destination. Another would be to encrypt the file just before it is attached to the email. This could be done within ABAP, but perhaps a third party public key encryptor would be better placed. This could be invoked via a system command call, or as an RFC. A third solution would be to have your mail server handle the encryption.
    Heres the link for the above explaination
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_gci1037837,00.html?track=sap805s
    One more link
    <a href=" http://www.telfordpct.nhs.uk/healthcare_professionals/SAP/creating_sap_documents_in_word_copy(1).htm ">http://www.telfordpct.nhs.uk/healthcare_professionals/SAP/creating_sap_documents_in_word_copy(1).htm</a>
    Regards
    Raj
    Message was edited by:
            Rajasekhar Dinavahi

  • How do I add a link for a file that can be downloaded

    I'm sure that there's a very simple answer to this, and I
    can't believe that I don't know it.
    How can I add a link to a file that will then be dowloaded by
    the user?
    Thanks

    Zip the file. Link to it. Upload it.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Si Fi" <[email protected]> wrote in message
    news:e73jd6$i3m$[email protected]..
    > I'm sure that there's a very simple answer to this, and
    I can't believe
    > that I don't know it.
    >
    > How can I add a link to a file that will then be
    dowloaded by the user?
    >
    > Thanks

  • How to let user download multi files at the same time in WebDynpro ABAP?

    hi all:
    As you know, WeyDynpor has provided upload/download UI element, but it seems that it only support one file upload/downlaod at the same time.The following is the API method to download one file in Webdynpro:
        cl_wd_runtime_services=>attach_file_to_response(
         EXPORTING
           i_filename      = lv_filename
           i_content       = lv_content
           i_mime_type     = lv_mine_type
           i_in_new_window = abap_true
           i_inplace       = abap_false
    *      EXCEPTIONS
    *        others          = 1
    but if when use click one button, we want to provide user a html file plus 2 icons files which are used as this html file's resource file, then how to let user download these 3 files together at the same time?
    one simple way is calling the download api (cl_wd_runtime_services=>attach_file_to_response) 3 times,
    but it is very ugly that three popup windows are shown to let user select every file's download path, which is unaccepted.
    So anyone know more convienient way to handle it?
    thanks.

    Hi,
    I suggest you to zip the files and attach it to the response. Do the add file part for each of your files
         "References
         DATA lr_zip TYPE REF TO cl_abap_zip.
         "Variables
         DATA lv_zip_xstring TYPE xstring.
         DATA lv_zip_name TYPE string.
         DATA lv_file_content TYPE xstring.
         DATA lv_file_name  TYPE string.
         "Create instance
         CREATE OBJECT lr_zip.
         "Add file
         lr_zip_attachments->add(
           EXPORTING name = lv_file_name
                  content = lv_file_content ).
         lr_zip_attachments->save( RECEIVING zip = lv_zip_xstring ).
         "Attach zip file to response
         cl_wd_runtime_services=>attach_file_to_response(
           EXPORTING i_filename      = lv_zip_name
                     i_mime_type     = 'ZIP/APPLICATION'
                     i_content       = lv_zip_xstring ).

  • Firefox opens up an explorer window when I download a file

    Recently, Firefox started opening up an Explorer window every time I download a file. It's Better Explorer, actually, since I use that to replace the Microsoft version. The folder that opens is the target destination. So it creates multiple tabs, but I expect that it would just open up multiple instances of Windows Explorer if that's what I used.
    So if I download a dozen images, I get a dozen tabs opened. This doesn't happen with IE or Chrome. I do have multiple extensions installed, but I've gone through the options in Firefox and any relating to downloads and none of them seem to have anything that might cause this. I did check the Applications tab under the Firefox Options, since that seemed like a probable cause. But I don't see anything. And I don't recall changing anything recently, in any case. I can't see anything in Better Explorer that would cause this behavior. Which is borne out by this not occurring in other browsers. And I haven't changed anything it, either.
    I tried downloading something with NetVideoHunter and I get the same behavior. But it doesn't happen with DownloadThemAll!
    I've tried researching it on-line, but the queries I use are apparently too similar to the ones for other issues, because nothing that comes up is even close to my problem.
    As this is getting very annoying, any help would be greatly appreciated. Firefox remains my favorite desktop browser and I'm not prepared to give it up over this. But I'd hate to have to reinstall it, since I have it configure just the way I want it. And I'm not even sure that would fix the issue.
    Thanks

    Start Firefox in [https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode safe mode] to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    Do NOT click the Reset button on the Safe Mode start window.
    * https://support.mozilla.org/kb/Safe+Mode
    * https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    In Firefox Safe mode these changes are effective:
    * all extensions are disabled (about:addons)
    * default theme is used (no persona)
    * userChrome.css and userContent.css are ignored (chrome folder)
    * default toolbar layout is used (file: localstore-safe.rdf)
    * Javascript JIT compilers are disabled (prefs: javascript.options.*jit)
    * hardware acceleration is disabled (Options > Advanced > General)
    * plugins are not affected
    * preferences are not affected
    Your profile folder contains a user.js file, which includes preferences that were not created by Firefox.
    so you may want to also check for a user.js file and DELETE that.
    * https://support.mozilla.org/en-US/kb/how-to-fix-preferences-wont-save#w_user-js-file-overriding-preferences

  • How do I stop firefox from pre-downloading a file during a file download prompt?

    I use DownThemAll as my download manager for files generally over 10MB, as my internet connection is generally too slow for firefox to download a file larger then this without firefox "finishing" a download before it's complete, corrupting the file. This never happens with DownThemAll.
    For some sites, either there is no download link to right click or it starts automatically, launching the download prompt. Firefox's internal download manager automatically starts downloading the file (not visibly, but in the background) before I can choose to use DownThemAll from the prompt instead.
    This wastes bandwidth. Even worse, some hosting sites have randomly generated download gates for each session that expire after disconnection or limit you to a single download in a given time frame. This means that I effectively can't use DownThemAll on certain websites because firefox's own download manager steps in and gets in the way.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • How to download a file version from office 365 using csom

    I need to download an older file version from office 365 and get the data into a byte array. I have no trouble downloading the latest version with File.OpenBinaryStream() and I have no trouble loading the previous file versions with File.Versions. But now
    I need to actually download an older version of the file and it seems the only way is to use File.OpenBinaryDirect. So I am creating a client context using my oAuth access token and providing the correct path, but I am getting a (401) Unauthorized
    error. Looking with Fiddler I can see that the call to OpenBinaryDirect is somehow trying to post to my file URL and the server is responding with 401.
    context = TokenHelper.GetClientContextWithAccessToken(SPHostUrl, AccessToken);
    FileInformation info = File.OpenBinaryDirect(context, "/" + _fileVersion.Url);  //throws 401
    //leading slash required otherwise ArgumentOutOfRangeException
    I have to be able to access the older file versions with my c# code -- I don't have a viable app without that ability -- any help urgently needed and greatly appreciated!

    Thank you SO much (Can't wait for the next release)!
    For anyone else who lands here, here's the code I ended up using:
    // VersionAccessUser and VersionAccessPassword are stored in web.config
    // web.Url is loaded via the clientContext
    // myVersion is the FileVersion I got from the file's Versions.GetById() method
    // probably a lot of ways to get hostUrl, it just needs to be https://yourdomain.sharepoint.com/
    // - I'm running my app from a subweb
    // I had trouble following the links to get the full MsOnlineClaimsHelper code
    // (the one on msdn.com was missing RequestBodyWriter, WSTrustFeb2005ContractClient,
    // and IWSTrustFeb2005Contract
    // so I've included the code I used here.
    string myVersionFullUrl = string.Format("{0}/{1}", web.Url, myVersion.Url);
    string userName = WebConfigurationManager.AppSettings.Get("VersionAccessUser");
    string strPassword = WebConfigurationManager.AppSettings.Get("VersionAccessPassword");
    string hostUrl = Regex.Replace(web.Url, "([^/]+//[^/]+/).*", "$1");
    MsOnlineClaimsHelper claimsHelper = new MsOnlineClaimsHelper(hostUrl, userName, strPassword);
    var client = new WebClient();
    client.Headers["Accept"] = "/";
    client.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
    client.Headers.Add(HttpRequestHeader.Cookie, claimsHelper.CookieContainer.GetCookieHeader(new Uri(hostUrl)));
    var document = client.DownloadString(myVersionFullUrl);
    // These classes are needed to download old versions of files (see: http://social.msdn.microsoft.com/Forums/en-US/7746d857-d351-49cc-b2f0-496663239e02/how-to-download-a-file-version-from-office-365-using-csom?forum=sharepointdevelopment)
    // I cobbled this file from http://social.technet.microsoft.com/Forums/msonline/en-US/4e304493-7ddd-4721-8f46-cb7875078f8b/problem-logging-in-to-office-365-sharepoint-online-from-webole-hosted-in-the-cloud?forum=onlineservicessharepoint
    // and http://fredericloud.com/2011/01/11/connecting-to-sharepoint-with-claims-authentication/
    using Microsoft.IdentityModel.Protocols.WSTrust;
    using Microsoft.SharePoint.Client;
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Net.Security;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.Text;
    using System.Web;
    using System.Xml;
    using System.Xml.Linq;
    namespace DPSiDoxAppWeb.Helpers
    /// <summary>
    /// Create a new contract to use for issue claims for the SharePoint requests
    /// </summary>
    [ServiceContract]
    public interface IWSTrustFeb2005Contract
    [OperationContract(ProtectionLevel = ProtectionLevel.EncryptAndSign,
    Action = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue",
    ReplyAction = "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue",
    AsyncPattern = true)]
    IAsyncResult BeginIssue(Message request, AsyncCallback callback, object state);
    Message EndIssue(IAsyncResult asyncResult);
    /// <summary>
    /// Implement the client contract for the new type
    /// </summary>
    public class WSTrustFeb2005ContractClient : ClientBase<IWSTrustFeb2005Contract>, IWSTrustFeb2005Contract
    public WSTrustFeb2005ContractClient(Binding binding, EndpointAddress remoteAddress)
    : base(binding, remoteAddress)
    public IAsyncResult BeginIssue(Message request, AsyncCallback callback, object state)
    return Channel.BeginIssue(request, callback, state);
    public Message EndIssue(IAsyncResult asyncResult)
    return Channel.EndIssue(asyncResult);
    /// <summary>
    /// Create a class that will serialize the token into the request
    /// </summary>
    class RequestBodyWriter : BodyWriter
    readonly WSTrustRequestSerializer _serializer;
    readonly RequestSecurityToken _rst;
    /// <summary>
    /// Constructs the Body Writer.
    /// </summary>
    /// <param name="serializer">Serializer to use for serializing the rst.</param>
    /// <param name="rst">The RequestSecurityToken object to be serialized to the outgoing Message.</param>
    public RequestBodyWriter(WSTrustRequestSerializer serializer, RequestSecurityToken rst)
    : base(false)
    if (serializer == null)
    throw new ArgumentNullException("serializer");
    _serializer = serializer;
    _rst = rst;
    /// <summary>
    /// Override of the base class method. Serializes the rst to the outgoing stream.
    /// </summary>
    /// <param name="writer">Writer to which the rst should be written.</param>
    protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
    _serializer.WriteXml(_rst, writer, new WSTrustSerializationContext());
    public class MsOnlineClaimsHelper
    #region Properties
    readonly string _username;
    readonly string _password;
    readonly bool _useRtfa;
    readonly Uri _host;
    CookieContainer _cachedCookieContainer = null;
    DateTime _expires = DateTime.MinValue;
    #endregion
    #region Constructors
    public MsOnlineClaimsHelper(string host, string username, string password)
    : this(new Uri(host), username, password)
    public MsOnlineClaimsHelper(Uri host, string username, string password)
    _host = host;
    _username = username;
    _password = password;
    _useRtfa = true;
    public MsOnlineClaimsHelper(Uri host, string username, string password, bool useRtfa)
    _host = host;
    _username = username;
    _password = password;
    _useRtfa = useRtfa;
    #endregion
    #region Constants
    public const string office365STS = "https://login.microsoftonline.com/extSTS.srf";
    public const string office365Login = "https://login.microsoftonline.com/login.srf";
    public const string office365Metadata = "https://nexus.microsoftonline-p.com/federationmetadata/2007-06/federationmetadata.xml";
    public const string wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    public const string wsu = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
    private const string userAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)";
    #endregion
    class MsoCookies
    public string FedAuth { get; set; }
    public string rtFa { get; set; }
    public DateTime Expires { get; set; }
    public Uri Host { get; set; }
    // Method used to add cookies to CSOM
    public void clientContext_ExecutingWebRequest(object sender, WebRequestEventArgs e)
    e.WebRequestExecutor.WebRequest.CookieContainer = getCookieContainer();
    //e.WebRequestExecutor.WebRequest.UserAgent = userAgent;
    // Creates or loads cached cookie container
    CookieContainer getCookieContainer()
    if (_cachedCookieContainer == null || DateTime.Now > _expires)
    // Get the SAML tokens from SPO STS (via MSO STS) using fed auth passive approach
    MsoCookies cookies = getSamlToken();
    if (cookies != null && !string.IsNullOrEmpty(cookies.FedAuth))
    // Create cookie collection with the SAML token
    _expires = cookies.Expires;
    CookieContainer cc = new CookieContainer();
    // Set the FedAuth cookie
    Cookie samlAuth = new Cookie("FedAuth", cookies.FedAuth)
    Expires = cookies.Expires,
    Path = "/",
    Secure = cookies.Host.Scheme == "https",
    HttpOnly = true,
    Domain = cookies.Host.Host
    cc.Add(samlAuth);
    if (_useRtfa)
    // Set the rtFA (sign-out) cookie, added march 2011
    Cookie rtFa = new Cookie("rtFA", cookies.rtFa)
    Expires = cookies.Expires,
    Path = "/",
    Secure = cookies.Host.Scheme == "https",
    HttpOnly = true,
    Domain = cookies.Host.Host
    cc.Add(rtFa);
    _cachedCookieContainer = cc;
    return cc;
    return null;
    return _cachedCookieContainer;
    public CookieContainer CookieContainer
    get
    if (_cachedCookieContainer == null || DateTime.Now > _expires)
    return getCookieContainer();
    return _cachedCookieContainer;
    private MsoCookies getSamlToken()
    MsoCookies ret = new MsoCookies();
    try
    var sharepointSite = new
    Wctx = office365Login,
    Wreply = _host.GetLeftPart(UriPartial.Authority) + "/_forms/default.aspx?wa=wsignin1.0"
    //get token from STS
    string stsResponse = getResponse(office365STS, sharepointSite.Wreply);
    // parse the token response
    XDocument doc = XDocument.Parse(stsResponse);
    // get the security token
    var crypt = from result in doc.Descendants()
    where result.Name == XName.Get("BinarySecurityToken", wsse)
    select result;
    // get the token expiration
    var expires = from result in doc.Descendants()
    where result.Name == XName.Get("Expires", wsu)
    select result;
    ret.Expires = Convert.ToDateTime(expires.First().Value);
    HttpWebRequest request = createRequest(sharepointSite.Wreply);
    byte[] data = Encoding.UTF8.GetBytes(crypt.FirstOrDefault().Value);
    using (Stream stream = request.GetRequestStream())
    stream.Write(data, 0, data.Length);
    stream.Close();
    using (HttpWebResponse webResponse = request.GetResponse() as HttpWebResponse)
    // Handle redirect, added may 2011 for P-subscriptions
    if (webResponse.StatusCode == HttpStatusCode.MovedPermanently)
    HttpWebRequest request2 = createRequest(webResponse.Headers["Location"]);
    using (Stream stream2 = request2.GetRequestStream())
    stream2.Write(data, 0, data.Length);
    stream2.Close();
    using (HttpWebResponse webResponse2 = request2.GetResponse() as HttpWebResponse)
    ret.FedAuth = webResponse2.Cookies["FedAuth"].Value;
    ret.rtFa = webResponse2.Cookies["rtFa"].Value;
    ret.Host = request2.RequestUri;
    else
    ret.FedAuth = webResponse.Cookies["FedAuth"].Value;
    ret.rtFa = webResponse.Cookies["rtFa"].Value;
    ret.Host = request.RequestUri;
    catch (Exception ex)
    return null;
    return ret;
    static HttpWebRequest createRequest(string url)
    HttpWebRequest request = HttpWebRequest.Create(url) as HttpWebRequest;
    request.Method = "POST";
    request.ContentType = "application/x-www-form-urlencoded";
    request.CookieContainer = new CookieContainer();
    request.AllowAutoRedirect = false; // Do NOT automatically redirect
    request.UserAgent = userAgent;
    return request;
    private string getResponse(string stsUrl, string realm)
    RequestSecurityToken rst = new RequestSecurityToken
    RequestType = WSTrustFeb2005Constants.RequestTypes.Issue,
    AppliesTo = new EndpointAddress(realm),
    KeyType = WSTrustFeb2005Constants.KeyTypes.Bearer,
    TokenType = Microsoft.IdentityModel.Tokens.SecurityTokenTypes.Saml11TokenProfile11
    WSTrustFeb2005RequestSerializer trustSerializer = new WSTrustFeb2005RequestSerializer();
    WSHttpBinding binding = new WSHttpBinding();
    binding.Security.Mode = SecurityMode.TransportWithMessageCredential;
    binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
    binding.Security.Message.EstablishSecurityContext = false;
    binding.Security.Message.NegotiateServiceCredential = false;
    binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
    EndpointAddress address = new EndpointAddress(stsUrl);
    using (WSTrustFeb2005ContractClient trustClient = new WSTrustFeb2005ContractClient(binding, address))
    trustClient.ClientCredentials.UserName.UserName = _username;
    trustClient.ClientCredentials.UserName.Password = _password;
    Message response = trustClient.EndIssue(
    trustClient.BeginIssue(
    Message.CreateMessage(
    MessageVersion.Default,
    WSTrustFeb2005Constants.Actions.Issue,
    new RequestBodyWriter(trustSerializer, rst)
    null,
    null));
    trustClient.Close();
    using (XmlDictionaryReader reader = response.GetReaderAtBodyContents())
    return reader.ReadOuterXml();

  • How to download a file from application server in webdynpro

    Hi Experts,
                       I am trying to download a file through Web Dynpro file download UI element..The file is stored in application server in binary format ..in my code i am reading the file in binary mode,converting Binary File into Xstring(Using FM SCMS_BINARY_TO_XSTRING) ..getting its Mime type and binding the UI element properties (data with XString, Mime type and file name) with respective context attributes..But the problem is file is getting opened but Junk data is getting displayed on it..Not sure where i am making the mistake.

    Hi Lukas,thanks for the reply..please find the code
    here '/tmp/accenturedocs'  is the folder name on application server,and zdocs_list_tab is the table that contains file URL.File upload is on the BSP page (custom logic to upload the file ) where they are storing local file path in ztable.Same i am extracting in my code to get File URL.
    DATA: i_file TYPE rlgrap-filename .
      DATA:v_path TYPE zlist.
      DATA:i_datatab TYPE STANDARD TABLE OF tbl1024,
           wa_datatab TYPE   tbl1024.
      DATA  file TYPE  string.
      DATA dot_offset TYPE i.
      DATA extension TYPE mimetypes-extension.
      DATA mimetype TYPE mimetypes-type.
      SELECT SINGLE description
        FROM  zdocs_list_tab
        INTO v_path.
      CONCATENATE '/tmp/accenturedocs' v_path INTO i_file.
      FIELD-SYMBOLS <hex_container> TYPE x.
      OPEN DATASET i_file FOR INPUT IN LEGACY BINARY MODE.
      IF sy-subrc NE 0.
        MESSAGE e999(00) WITH 'Error opening file' .
      ENDIF.
      ASSIGN  wa_datatab TO <hex_container> CASTING.
      DO.
        READ DATASET i_file INTO <hex_container>.
        IF sy-subrc = 0.
          APPEND wa_datatab TO i_datatab.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
      CLOSE DATASET i_file.
      DATA:l_count TYPE i,
            l_len TYPE i.
      DESCRIBE TABLE i_datatab LINES l_count.
      READ TABLE i_datatab INTO wa_datatab INDEX l_count.
      l_len = XSTRLEN( wa_datatab-line ).
      l_len = l_len + ( l_count - 1 ) * 1022.
    DATA: v_xstring TYPE xstring.
      CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
        EXPORTING
          input_length = l_len
        IMPORTING
          buffer       = v_xstring
        TABLES
          binary_tab   = i_datatab
        EXCEPTIONS
          failed       = 1
          OTHERS       = 2.
      IF sy-subrc <> 0.
      ENDIF.
    file = i_file.
      " Find out file name extension
      FIND FIRST OCCURRENCE OF REGEX '\.[^\.]+$' IN file MATCH OFFSET
      dot_offset.
      ADD 1 TO dot_offset.
      extension = file+dot_offset.
      " Get mime type
      CALL FUNCTION 'SDOK_MIMETYPE_GET'
        EXPORTING
          extension = extension
        IMPORTING
          mimetype  = mimetype.
    DATA lv_file_content TYPE wd_this->element_context-file_content.
    get element via lead selection
      lo_el_context = wd_context->get_element( ).
    set single attribute
      lo_el_context->set_attribute(
        name =  `FILE_CONTENT`
        value =  v_xstring ).
    same way i am assigning file name and file mime type to context attributes.
    please suggest where is the mistake.

Maybe you are looking for

  • About Java mapping and java proxy

    Hi Iam new to Xi and basically iam an ABAPER.When iam dooing mappinps or proxies i cant able to understand the java pari cant (javamapping and java proxies) .I need some notes on java mapping and java proxy which is easy to do.And why do we use this

  • Getting error in alert log file in DR SITE

    Database Characterset is WE8ISO8859P1 replication_dependency_tracking turned off (no async multimaster replication fou nd) Completed: alter database open read only Tue Oct 14 13:30:15 2008 Errors in file /arch/dump/udump/icai_ora_12168.trc: ORA-00600

  • Problem wtih JDBC Connecting in jsf program.

    Hey guys. I have a web app setup thanks to some of you guys on here. I'm using mysql jdbc access for login. I'm using the connection pool and resource for connectivity. Basically what I'm asking is can I use to DataSource variables on the same page.

  • Sorting in DimensionTree

    Is it possible to set up sorting in the DimensionTree jsp component? We need sort the items in the hierarchy by some attribute, but I could not find out how. Thanks.

  • Newbie to Java

    I'm writting a program for school and I know the answer is simple(I hope) I just can't see it. I'm using TextPad and I've been able to debug my programs with no problem - until now. Here's the error I get: unexpected type required : variable found :