I am using VS 2008 with .NET 3.5 and after I put the control on the page and let it import it's ig_ui folder I added the following headers.
<link type="text/css" href="ig_ui/themes/ig/jquery.ui.custom.min.css" rel="stylesheet" /> <link type="text/css" href="ig_ui/themes/base/ig.ui.min.css" rel="stylesheet" /> <script type="text/javascript" src="js/jquery-1.6.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.13/jquery-ui.min.js"></script> <script type="text/javascript" src="ig_ui/js/min/ig.ui.min.js"></script>
I also tried using the Microsoft CDN for jQuery and jQueryUI. Then end result is that the page opens up and control looks good and brings up the find file dialog as expected but it never actually uploads the file. The progress bar opens, blinks a bit and then goes away. No file is to be found in the destination folder. The Uploaded events don't fire client or server side.
I added the modules and handlers shown in the help site and documentation but the behavior was exactly the same. It doesn't throw any exceptions so I can't even figure out where to start looking.
<modules> <remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="IGUploadModule" type="Infragistics.Web.UI.EditorControls.UploadModule" preCondition="managedHandler" /> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/> <remove name="ScriptResource"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*" type="Infragistics.Web.UI.EditorControls.UploadStatusHandler" preCondition="integratedMode" /> </handlers> </system.webServer>
Any help at all would be greatly appreciated.
Hi legionxiii,
My advice is to check for javascript errors. Also please attach from client side to the javascript event onError. Event handler could look something like this:
function onError (event, args) {alert('errorCode: ' + args.errorCode + ', errorMessage: ' + args.errorMessage + ', errorType: ' + args.errorType);}
It will alert error code and error message(which I hope it will help you debugging).
Most common errors for your case are:
1. Not properly set path of httphandler <add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*" type="Infragistics.Web.UI.EditorControls.UploadStatusHandler" preCondition="integratedMode" />2. Not properly set upload folder
3. Not set write permissions for upload folder
If you have not set upload folder then default upload folder should be with name "Uploads" in the root folder
As I see you have configured system.webServer - are you sure you test your site through IIS7. For instance if you are using development server or IIS6 you should configure httphandler/httpmodule in <system.web> section.
Thanks,Miro Hristov
I am testing in IIS on my windows 7 machine, but our production server is IIS6 currently. I added the errorhandler and it is showing undefined for all the error codes. If I put a bad command in the handler to force a break I get the following if I drill down into the watched variables.
"{"size":0,"serverMessage":"","status":3,"bytesUploaded":0,"error":5}"
According to your charts that is saying file not found. I am not sure why that is happening. I created an empty project in the same place as the existing project and when I added the control and went to design mode it updated all the settings it needed and worked perfectly. I even went so far as to copy the web config over from the project that is not working and it still worked fine in the new project. I updated the folder security so both have exactly the same permissions on them and I get the same results; the first project throws the error above and the second one works fine. In both cases I am uploading the exact same file from the exact same location.
Here is the web config used in both projects currently.
<?
?>
<
>
/>
</
<!--
-->
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
Hi ChSamtleben,
I suppose probably you are working on MVC project - please check our MVC samples http://samples.infragistics.com/jquery/file-upload. If I am not right - just you can check ASP.net samples http://samples.infragistics.com/aspnet/ComponentOverview.aspx?cn=web-upload
It will be very helpful for us to send more information about your problem: what exactly project is, your web.config, if it is possible for you some little project with page that contains the file upload. Thanks,Miro Hristov
Hi MIro,
I found the problem:
If I use the default uploadpath, I do not set the UploadUrl property the upload works fine.
I would like webupload does not save the file anywehre in the filesystem. I want th file as stream, How would I accomplish this?
Thanks
Christian
Hi Christian,
You can set the upload path in the web.config. This is the temporary folder where it is saved files(please specify it in the web.config) - then you can attach to event UploadFinishing(as I see you have done this) and there you can do anything you want with the temporary file(which is already uploaded but not renamed to its original filename). First you should cancel the event and then you can remove the file/ move to another folder, etc. Canceling is made in this way:
e.Cancel = True
About the feature with saving file as a stream- for now there is no such option. In future we will implement it.
Regards,
Miro Hristov
Hi Miro,thank you for your advice.
Does your posting mean that the property "UpLoadUrl" cannot be set at runtime? If so, this property seams to be useless.
Ok, the control does not support streams. I will have to read the tempfile into my own stream.
Thank you very much
The property UploadUrl is related with the client side code of WebUpload(the jQuery widget). UploadUrl is for advanced use and in almost all of the cases you wil not need to change it. This property is for configuring the path where upload requests are made from the client side.
Best Regards,