Problem Viewing Accessed Files from Shared Folder

6 posts, 0 answers
  1. Konstantinos
    Konstantinos avatar
    8 posts
    Member since:
    Apr 2012

    Posted 11 May 2012 Link to this post

    Greetings,

    Since I want to be as short as possible here is the thing...
    I implemented File Explorer fetching files from a Shared folder, exactly as this post indicated (post). However while I fetch the data and I can see the file hierarchy and the files, when I am trying to open the files I get this message:

    Server Error in '/' Application.

    The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /Functions/Ethnological/FileSystemHandler.ashx


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272           


    That is a "normal" Http error... Which is pretty weird since, as I said, I can see the files... In the shared folder I have full read/write etc permissions... When I tried accessing these files through a local folder, everything went as expected and I also had preview (which now I do not).

    Still, if you want to see the code, just in case here it is...

    In .cs
    string[] viewPaths = new string[]
                        {
                            @"\\cmarinis-pc\ArchiveImages"
                        };
     
                        string[] uploadPaths = new string[]
                        {
                            @"\\cmarinis-pc\ArchiveImages"
                        };
     
                        string[] deletePaths = new string[] 
                        {
                            @"\\cmarinis-pc\ArchiveImages"
                        };
     
                        rfExplorer.Configuration.ViewPaths = viewPaths;
                        rfExplorer.Configuration.SearchPatterns = new[] { "*.*" };
                        rfExplorer.Configuration.ContentProviderTypeName = typeof(CustomFileSystemProvider).AssemblyQualifiedName;

    In .aspx
    <telerik:RadFileExplorer runat="server" ID="rfExplorer" Width="600px" Height="270px"
        OnClientItemSelected="OnClientItemSelected">
    </telerik:RadFileExplorer>

    and the mapping file.

    <?xml version="1.0" encoding="utf-8" ?>
    <CustomFileBrowserProvider>
      <Paths>
        <genericHandlerPath>FileSystemHandler.ashx</genericHandlerPath>
      </Paths>
      <Mappings>
        <Mapping>
          <PhysicalPath>
            <![CDATA[\\cmarinis-pc\ArchiveImages]]>
          </PhysicalPath>
          <VirtualPath><![CDATA[Shared/]]></VirtualPath>
        </Mapping>
     
      </Mappings>
    </CustomFileBrowserProvider>


    So where could this problem be???

    PS: Another crucial, but a little out of the topic matter, is that I want to open .tif images with the explorer. I can open .tif images with the windows photo viewer, but not with the explorer. Any ideas???

    Thanks in advance :)
    Konstantinos Marinis
  2. Konstantinos
    Konstantinos avatar
    8 posts
    Member since:
    Apr 2012

    Posted 14 May 2012 Link to this post

    Ok, I have managed to overcome quite a lot of the stuff I described.... At least now, everything is functional :)
    Still I have another problem now....
    The .tiff images part? Now trying to view them in browser, fires an open/download prompt. Then the user can open the .tiff files in windows photo viewer...

    There are however two functionality problems...
    1) I want the panel that is displayed, hidden. Preferably before the image opening, but surely AFTER!
    I understand this should happend client-side with javascript and .css display:none property, but I haven't manage to do this yet...
    I am currently trying using this post (it is the most relative thing I could find...), but no luck so far...
    2) Is there any way to fire the open button? Opening and Downloading messages to the user can be disorientating...

    Thank you in advance...
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 15 May 2012 Link to this post

    Hi Konstantinos,

    In order to preview a file with the RadFileExplorer's Preview dialog the file should be type that the browser can display. The tiff image format is not supported by the browsers, so I would recommend you to implement file download functionality as described in the following Live Demo:
    FileExplorer / Filter files and download

    I am not quite sure I understand your second question, so correct me if I am wrong but your requirement is to directly show the download's dialog when double click on a file or use the toolbar's Open button. If this is the case, the approach used in the above mentioned example handles this case - by handling the client-side ClientFileOpen event and cancel its default execution.

    Greetings,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Konstantinos
    Konstantinos avatar
    8 posts
    Member since:
    Apr 2012

    Posted 15 May 2012 Link to this post

    Thank you so much for your reply.

    Your second answer was close to my question but not there yet... Sorry if I was disorientating...
    In the example you gave me with "open images for direct download" option checked it opens a promt message to either open or download the file. I wanted to know if there is a way to directly open the file without the promt to the user? I mean user double-clicks an image, photo viewer starts up and render the image.

    Currently, I am using a peculiar and alternative way to overcome that problem. I have disabled the EnableOpen file, so double-clicking does nothing. OnClientItemSelected I get the path of the item and pass it to a hidden label, so when user calls OnClientFileOpen, javascript fires a button that calls a method in CodeBehind. That method gets the current ItemSelected in hidden label and does a Process.Start(image_path).

    Yeah, quite a workaround, I know, but it works... If you can tell me that there is a way immediately open a picture without a promt to the user to download/open it, I would happily apply it to my project...

    Thanks again for your troubles :)
  6. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 16 May 2012 Link to this post

    Hi Konstantinos,

    The download dialog that pops up is a browser dialog and RadFileExplorer does not have control over it.

    Actually this is confirmation dialog asking the user if the file should be downloaded. In general, it is not (or at least should not be possible) to force file download without the user's confirmation. If such operation is possible it will be a major security breach.

    Greetings,
    Dobromir
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Konstantinos
    Konstantinos avatar
    8 posts
    Member since:
    Apr 2012

    Posted 16 May 2012 Link to this post

    Yes, I guessed so...

    Thanks again Dobromir for your effort..
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017