Saturday, March 24, 2012

about file upload2

Hi,

I have a fileupload control inside update panel however I don't need to upload any file I just need the file path and filename etc...

eventhough I can see it pastes the path inside the fileupload text part, I can't read it programmatically..

Thankss.

Why do you need the path to a file on the client computer? You can't read a file from the client computer anyway. What are you trying to achieve?


Dim instance As FileUploadDim value As Stringvalue = instance.FileName
.....................
 FileUpload.FileName:Gets the name of a file on a client to upload using theFileUpload control.

gridview:

Dim instance As FileUploadDim value As Stringvalue = instance.FileName
.....................
 FileUpload.FileName:Gets the name of a file on a client to upload using theFileUpload control.

Note that the original posted wanted the filename AND the path..


alexdresko:

Why do you need the path to a file on the client computer? You can't read a file from the client computer anyway. What are you trying to achieve?

This question reminded me how dumb I am :) thanks..

Well I'm coding a webmail interface and my mail server COM API asks for the path but this path is my server's path not the clients :D ok..

But if I know the path somehow; couldn't I upload the file programmatically? without fileupload control, I mean ok it ease the life but if it doesn't work inside an update panel how can I come up with?

Thanks for the reply..


No, you have to use the fileupload control. When the page posts back, you can save the file they uploaded to your server and from THAT you can determine the path to pass to your COM API.

Make sense?


Yes got it;

Thanks..

So is there anyway to do it with updatepanel?


No. You have to wrap your fileupload control within another updatepanel and set EnablePartialRendering = False. Supposedly there are other workarounds, and I know there is at least one third party AJAX enabled upload control, but the built-in fileupload control doesnt work with ajax..


Thanks for the reply;

Do you mean EnableViewState=False?? cause I couldn't find such property (EnablePartialRendering=False)

No comments:

Post a Comment