4 Answers, 1 is accepted
0
Hi Chris,
The StoreFile function returns the path to the stored item and we do not recommend you replace that behavior. Could you please provide more details on what exactly you want to achieve?
Sincerely yours,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The StoreFile function returns the path to the stored item and we do not recommend you replace that behavior. Could you please provide more details on what exactly you want to achieve?
Sincerely yours,
Fiko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Adam
Top achievements
Rank 1
answered on 19 Jul 2011, 05:54 PM
I also have a need for this. We are using the custom file provider example to allow people to have access to their home directory when they are not on site. However, they have a limited amount of space. When they hit their space limit, I'd like to report a nice message instead of it just throwing an exception. The exception that is being caused when they run out of space is: There is not enough space on the disk.
0
juan
Top achievements
Rank 1
answered on 21 Jul 2011, 03:28 PM
i have the same problem, i want to verify if i have space in the hard disk when the users upload files or the extension file using my code. Who is posible to verify this and put the message in the frontend?
Thanks.
Thanks.
0
Hi guys,
To achieve the required functionality you can override the StoreFile() method of the content provider, handle the exception and use the ScriptManager.RegisterStartupScript() to display an alert with the custom message. You can get reference to the Page object from the content provider using the following code:
The following is a sample StoreFile() method that pop-ups an alert:
I hope this helps.
Regards,
Dobromir
the Telerik team
To achieve the required functionality you can override the StoreFile() method of the content provider, handle the exception and use the ScriptManager.RegisterStartupScript() to display an alert with the custom message. You can get reference to the Page object from the content provider using the following code:
var page = HttpContext.Current.Handler
as
Page;
The following is a sample StoreFile() method that pop-ups an alert:
public
override
string
StoreFile(UploadedFile file,
string
path,
string
name,
params
string
[] arguments)
{
try
{
throw
new
IOException(
"Forced Exception"
);
}
catch
(IOException e)
{
var page = HttpContext.Current.Handler
as
Page;
ScriptManager.RegisterStartupScript(page, page.GetType(),
"key"
, @
"alert("
"Custom Error Message!"
");"
,
true
);
}
return
base
.StoreFile(file, path, name, arguments);
}
I hope this helps.
Regards,
Dobromir
the Telerik team
Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!