Can't send parametermessage back to client AND can't upload file in DEPLOYMENT

4 posts, 0 answers
  1. Edward Pauley
    Edward Pauley avatar
    48 posts
    Member since:
    May 2010

    Posted 28 Jul 2011 Link to this post

    Hi
    I have two problems. Check around the forum threads but still can't fix them. Please help me asap. Thanks

    1. I want to send Either parametermessage string / or an integer (doesn't matter which one) back to client side on the UploadFailed event to tell the user what kind of errors from the imported file are. However, the sent message is always empty string no matter what i tried.
     This is what i do .
    On server side:
        
    public override void ProcessStream()
           {
               this.AddReturnFileParam(RadUploadConstants.ParamNameFinalFileRequest, this.IsFinalFileRequest());
     
               bool success = true;
               if (this.IsFinalFileRequest())
               {
                     //I use these two statements to send the message back to client
                     this.AddReturnParam(RadUploadConstants.ParamNameMessage, "Correct Xml schema but Incorrect Xml datas");
                     this.AddReturnParam(RadUploadConstants.ParamNameSuccess, false);
                      return;
               }
              
              
           }
     
          
        
           public override Dictionary<string, object> GetAssociatedData()
           {
               Dictionary<string, object> dict = base.GetAssociatedData();
               if (this.IsFinalFileRequest())
               {       
                       dict.Add("TBDocumentId",_tbDocumentId);
                   
               }
               return dict;
           }
     
       }
    and this is the code for UpdatedFailed event handler to retrieve the message. But don't know why the message is always empty string
    private void radUpLoad_FileUploadFailed(object sender, FileUploadFailedEventArgs e)
            {
                
                    RadWindow.Alert(e.ErrorMessage);
                
            }


    2. My second question is that Before updating to Q2 2011.2.712.35 version (used Q1 version) i can use the radUpload in the deployment mode . However, right now i can only use it in the debug mode. Everytime i published the website and run. I will always get this error "Cannot save the file:[Access to the path C:inetpub\wwwroot\SilverSG\FileUploads\test.qbo is denied] (after selecting a file and click on the upload button)

    This is the xaml code for my radUpload
    <telerik:RadUpload Name="radUpLoad" IsEnabled="False"  FileUploaded="radUpLoad_FileUploaded" FileUploadStarting="radUpLoad_FileUploadStarting" FileUploadFailed="radUpLoad_FileUploadFailed"
                               IsMultiselect="False"  IsAppendFilesEnabled="False"
                         BufferSize="1000000"  MaxFileSize="1000000"   TargetFolder="FileUploads" Filter="Xml Files (*.xml)|*.xml" Width="Auto" Grid.Row="1"/>

    Code behind (need to use physically address for the UploadServiceUrl instead of relative one because of the "Buffer size error")
    public ImportTimeSheet()
            {
                InitializeComponent();
               
     
                //Setup the service URL for uploader
                string sBaseUrl = Application.Current.Host.Source.ToString().ToLower();
                int iIndexOfClientBin = sBaseUrl.IndexOf("/clientbin");
                sBaseUrl = sBaseUrl.Substring(0, iIndexOfClientBin);
                radUpLoad.UploadServiceUrl = sBaseUrl + "/ImportTBDocumentLineXML.ashx";
     
            }

    I already look around but still can't find a solution for it. Plz help

    thanks
  2. Edward Pauley
    Edward Pauley avatar
    48 posts
    Member since:
    May 2010

    Posted 29 Jul 2011 Link to this post

    any help. I need to fix my second question asap because right now our users can't use the radUpload anymore. 

    (the first question might be later if you have time)

    Note: for second question, i have tried to comment out all of the code stuff in the ImportTBDocumentLineXML.ashx on the server in order to verify whether the Radupload works fine in the default feature of it or not (or is it because of my modified code for ProcessStream()).
    However, I still get the same error even with using the default feature of radupload so it is not my server code problem.


    thanks
  3. DevCraft banner
  4. Edward Pauley
    Edward Pauley avatar
    48 posts
    Member since:
    May 2010

    Posted 01 Aug 2011 Link to this post

    hi

    plz help me. I still can't figure out how to fix my above two questions

    thanks
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 03 Aug 2011 Link to this post

    Hello Edward,

    There are a few things that I cannot entirely understand from the code snippets you sent. Firstly I don't understand what you need to implement on the server side - in what case the upload should fail and return the custom message? Also, I am not sure why you are overriding the ProcessStream() method. It would be safer to implement your custom logic in the SaveChunkData method. Still, please let me know if I am missing something from your logic.

    I attached a sample project where I implemented some mock-up logic to validate the upload on the server side and return a custom error message to the client. Please have a look at it and let me know if this is close to what you need to implement.

    Unfortunately, we cannot reproduce the second issue on our side and we will need more info to be able to further assist you in resolving it. From the error message you receive it seems that the issue is caused by authorization rights on the server. What is strange in this case is the fact that before the upgrade you had no issues. This is why I wanted to ask you from what Telerik version you've upgraded and if you've changed any settings on your deployment server around the time of the upgrade? Also, can you send us a screencast demonstrating the steps to reproduce the issue and a sample project so that we can test it locally and examine your scenario. Any additional info that you can give us about the configuration of your deployment server will be helpful as well.

    On a side note, I just wanted to encourage you to take advantage of the support ticketing system (http://www.telerik.com/account/support-tickets/new-support-ticket.aspx) in cases when you need a prompt response to urgent issues. This is the best way to reach our support staff - the support system assigns a response time for all of your questions, depending on your license and ensures that all questions will reach the respective developers, if needed.

    Looking forward to your reply,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Back to Top