|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
I am using Ajax uploader but I want to make the textbox of the fileUploader to be "readonly".
I am using this code on my asp.net/C# page load event bt no success.
fileUploader.TextBoxStyle.InlineStyle["readonly"] = "readonly";
Can you tell me how can I make AJAX Uploader textbox as readonly textbox?
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, You can hide it, but you can not make it read only. See here for a working example about hiding the textbox: http://demo.essentialobjects.com/Default.aspx?path=AJAXUploader\uploader_toolbarRead only is automatically handled by the browser. It is automatically read only on Safari and Google Chrome and not read only on other browsers. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
The example link that you gave is for AJAX toolbar hoever, I am specifically asking about AJAX Uploader only.
How can I hide AjaxUploader textbox so that no one can type in the path in it and could use BROWSE functionality only??
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You can not. You must use it together with a toolbar in order to hide the uploader textbox. You can however customize the toolbar to a single button so it doesn't look like a toolbar at all.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
I have to use the complete AJAX Uploader and not as toolbar. Therefore, I wanted to make the textbox as read only because there are some cases where a user types in an invalid file name but still uploader shows something like "ABC.xls - (0 Bytes) uploaded" message.
You may try and tell me if could resolve it.
Consider following senarios:-
Using AJAXUploader without embedding it into the AJAX Toolbar
Use Browse, CANCEL, Delete option but not Upload option. Make AUTO Upload = "True".
Now, when you run the application, type in something like this "C:\Documents and Settings\Desktop\ABC.xls" where ABC.xls does not exist on desktop.
You will see that although this excel file does not exist on desktop but still AJAX Uploader uploads and shows a message as I gave you above.
This is the issue that I am facing, I do not want the user to put in this type of inputs as this is leading to abnormal behaviour of the application.
Can you please suggest in this case?
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, I believe we have already answered both of your question in our previous reply: 1. You can not display the full uploader with a read-only textbox; 2. The "empty file" question you asked in this thread: http://www.essentialobjects.com/forum/postst3551_AJAX-Uploader.aspxThe solution is the same --- You need to check the file on the server side after you receive it. This is the solution you should take. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
I don't know whether you have tried the above given scenarios or not, but just wanted to be sure that you know what exactly I am asking.
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Yes. We believe we understood your question correctly. The answer is the same. You can not make the textbox readonly and you must handle the empty file situation in your server side code.
This issue is now closed.
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
Please do not mix 'empty file' question with this topic. That one I have taken care of. Secondly, I still believe you have not tried my steps otherwise you would have seen something strange with the AJAXUploader behaviour.
If you want to close it ...close but still I doubt you have not tried it.
Thanks a ton!!!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
We know exactly what you are talking about and we are not mixing the topic here. A browser does not tell you a file does not exist on the client side because otherwise it would potentially allow people to write code to test whether a file exists on the client side, which is a security hole. So instead of telling you the file does not exist, it uploads an empty file for you. As a result, as far as you concern, “file does not exist” and “empty file” are exactly the same situation because browser always uploads an empty file for you when the file does not exist.
Hope this clears up.
Thanks
|
|