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
9 Answers, 1 is accepted
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...
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
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 :)
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
Thanks again Dobromir for your effort..
Hi All,
Im getting 404 error while opening the folders from right panel of FileExplorer control.
When we open the folders from left panel, it is working fine. When we open the folders from right panel, the browser's address bar got changed and we got 404 error.
Thanks & Regards
Vijay G
I tested the described scenario and I am able to open folder in the control both from the Grid and the TreeView on the left. Can you, please, share some more details on the matter like:
- Which version of the controls do you use in your application? Is it the latest one?
- Does the problem occurs in all browsers o just in specific one?
- Are you reproducing the same error in our online demos?
- Are you using a custom content provider for RadFileExplorer? If so - is it a one provided by us, or you have implemented it on your own?
It will be really helpful if you send us an isolated version of you project containing only the code needed to reproduce the problem, so we can examine it further at our end.
Looking forward to your reply,
Vessy
Progress Telerik
Hi Vessy,
Thanks for your reply.
We are using Telerik UI version 2016.3.914.45
Yes, We are using Custom Content Provider for RadFileExplorer. But I'm not sure whether it is provided by you. Because we got this code from some other vendor and we are fixing the issues. Can u pls send me your version of Custom content provider, So that I can compare and confirm you.
I can able to replicate the issue both in IE & Firefox , and the online demo is working fine for me in the same browser.
When i click on the folders in right panel, it is expecting the folders in deployed path of the page as shown in attachment.
Private Sub ConfigureFileExplorer()
rffMain.Configuration.ContentProviderTypeName = GetType(CustomColumnsContentProvider).AssemblyQualifiedName
AddGridColumn("Creation Date", "Date", True)
rffMain.Configuration.SearchPatterns = New String() {"*.xls", "*.xlsx", "*.pdf", "*.txt", "*.csv", "*.zip"}
rffMain.Configuration.MaxUploadFileSize = 100000000
rffMain.Upload.MaxFileInputsCount = 1
rffMain.Upload.InitialFileInputsCount = 1
Thanks & Regards
Vijay G
Thank you for the provided additional information. The content provider implemented by us can be downloaded from the following KB article:
https://www.telerik.com/support/kb/aspnet-ajax/fileexplorer/details/use-radfileexplorer-with-physical-and-shared-folder-s-paths
While comparing your own provider will it, please make sure that all methods mandatory for a custom FileSystemContentProvider are implemented in the one used by you (including the CheckDeletePermissions, CheckWritePermissions and CheckDeletePermissions ones. You can find a list will all needed methods here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/fileexplorer/server-side-programming/use-custom-filebrowsercontentprovider#2-implementing-a-custom-telerikwebuiwidgetsfilebrowsercontentprovider
Regards,
Vessy
Progress Telerik