Forum  Core :: SDK (Vi...  Developing the ...  The given path's format is not supported
Previous Previous
 
Next Next
New Post 3/22/2009 6:46 PM
  basemawad
33 posts
No Ranking


The given path's format is not supported 

 

I am using VWG Openfiledialog which is a crapy replacement of asp.net fileupload control. Anyway, I click add button, file browser comes up, I select a txt file, then it showsup in the list, I click OK, I get this error The given path's format is not supported.

I want to store the text file in resources\data folder on the server. Here is the code snippet when Ok buton is clicked.

private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
{
Gizmox.WebGUI.Common.Resources.HttpPostedFileHandle file =
(Gizmox.WebGUI.Common.Resources.HttpPostedFileHandle)openFileDialog1.Files[0];

Please try to be elaborative in your answer. Am I doing this correct? what could be invalid about the path? Can spaces in the path be a problem? Is there another way to save the file to that location. I basically want to upload a text file from client machine to a location on the server.

 

//and then you can get the filename via the variable:
this.textBox1.Text = file.PostedFileName;

//then if you wanted to store the file locally on the server you use the command.
m_filePath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + @"\Resources\Data\" + file.PostedFileName;
file.SaveAs(m_filePath);
}

 
New Post 3/23/2009 6:39 AM
  ori.cohen
4401 posts
1st Level Poster




Re: The given path's format is not supported 

Hello,

Please specify at what point in your code do you get that exception.
To see exactly from where in code this exception is generated, in Visual Studio after loading your application and before running it, press on "Ctrl" + "Alt" + "E". In the window that opens, check the checkbox of the "Common Language Runtime Exceptions" item. Run the application in debug mode.

It may be very helpful if you could please describe to me what is it that you are trying to accomplish in the flow UI, and what is the scenario you are constructing in your application. It would greatly help me to see the bigger picture. I would be able to either, open an issue for required changes in our framework, or suggest to you the best implementation available to achieve what you want in your VWG application.

Regards,

Ori Cohen
Support Manager, the Visual WebGui team

 
New Post 3/23/2009 11:39 AM
  basemawad
33 posts
No Ranking


Re: The given path's format is not supported 
 
I am not getting this on my development machine. This is what I get on the the production machine. 

The given path's format is not supported.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: The given path's format is not supported.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NotSupportedException: The given path's format is not supported.]
   Gizmox.WebGUI.Server.Content.ProcessRequest(HttpContext objHttpContext) +1432

[HttpException (0x80004005): The given path's format is not supported.]
   Gizmox.WebGUI.Server.Content.ProcessRequest(HttpContext objHttpContext) +4369
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

 
New Post 3/23/2009 5:06 PM
  palli
16672 posts
1st Level Poster




Re: The given path's format is not supported 

Hi,

You might be missing the too obvious thing here.... Note that in your code the:

file.PostedFileName

Will contain the full path of the local file selected, which might be something like "c:\temp\xxx.dat". When you later concat that via:

m_filePath = System.Web.HttpContext.Current.Request.PhysicalApplicationPath + @"\Resources\Data\" + file.PostedFileName;

You will of course get illegal filename !

What you need is take just the filename, by using something like:

System.IO.Path.GetFileName(file.PostedFileName)

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com

Please include VWG version information with your questions (best: Full name of VWG installation .MSI file)
To send sample code or other files to support, first zip the relevant project or files,
then rename .ZIP file to different extension like .XIP and finally email as attachment to email address above.
Remember to include full Http Url to the forum thread in the message.
 
New Post 3/23/2009 6:35 PM
  basemawad
33 posts
No Ranking


Re: The given path's format is not supported 

Hi Pali, thisfixed the problem. I think postedfilename sometimes returns the filename and sometimes it returns full path. I think it is not consistent. Anyway, your suggestion makes sure we get the filename only.

Thanks,

Basem

 
Previous Previous
 
Next Next
  Forum  Core :: SDK (Vi...  Developing the ...  The given path's format is not supported