Mar 16, 2010, 9:07 AM
How to Get Full Path of FileUploadField by JAVASCRIPT or listerner
Hi All,
I have a FileUploadField inside a GridPanel.
I want to get the full name from javascript or using listeners or AjaxMethod.
Its working fine in IE 7 i am getting the full Path by using the code, but not getting full path name in Mozilla or google chrome using the code below , there " (#{fileAttachment}.getValue())" give me the full path name in IE but not in mozilla or chrome..
I mean if in IE its give me the path like.. "C:\\UploadedFile\Files\MyuploadFile.jpg"
but in Mozilla or chrome its give me only " MyuploadFile.jpg".
My FileUploadField is inside the Gridpanel , so i donot know how to use .. "fileAttachment.FileName" or "fileAttachment.PostedFile.FileName".
Thanks and Regards
Kunal Mehata.
India
919971261098
I have a FileUploadField inside a GridPanel.
I want to get the full name from javascript or using listeners or AjaxMethod.
Its working fine in IE 7 i am getting the full Path by using the code, but not getting full path name in Mozilla or google chrome using the code below , there " (#{fileAttachment}.getValue())" give me the full path name in IE but not in mozilla or chrome..
I mean if in IE its give me the path like.. "C:\\UploadedFile\Files\MyuploadFile.jpg"
but in Mozilla or chrome its give me only " MyuploadFile.jpg".
My FileUploadField is inside the Gridpanel , so i donot know how to use .. "fileAttachment.FileName" or "fileAttachment.PostedFile.FileName".
<ext:Column DataIndex="FILENAME" Header="Add Attachment" Width="140px">
<Editor>
<ext:FileUploadField runat="server" ID="fileAttachment" ButtonOnly="true" ButtonText="Add File"
AllowBlank="true">
<Listeners>
<FileSelected Handler="#{AjaxMethods}.GetFileName(#{fileAttachment}.getValue());" />
</Listeners>
</ext:FileUploadField>
</Editor>
</ext:Column>
[AjaxMethod]
public void GetFileName(string strValue)
{
// its work in IE but not work in Mozilla.
int _intIndex = strValue.LastIndexOf('\\');
string strFileName = strValue.Substring(_intIndex+1);
}
Can you please help me to get the full file path (like C:\\UploadedFile\Files\MyuploadFile.jpg instead of just "MyuploadFile.jpg) on client side.Thanks and Regards
Kunal Mehata.
India
919971261098