By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

Help- File upload using ajax

vikysaran
P: 14
Hi,
Please check the attachment http://www.golsinc.com/app7/AJAXEnabledWebSite.zip
Here i made a small application for file upload. Made a huge form and need image upload without page refresh here.

i tried a lot, searched over net but finally my page is posting back on button click. If i dont use

<Triggers>
<asp:PostBackTrigger ControlID="Button1" />
</Triggers>

then it shows error in alert box "Object reference is not set to...."


please check the application and revert me ASAP....

Thanks in Advance....
Nov 10 '08 #1
Share this Question
Share on Google+
6 Replies


Dormilich
Expert Mod 5K+
P: 8,639
if your problem comes from asp (at least that's what it seems to me) you should ask a moderator to move this thread to the asp forum.

regards
Nov 10 '08 #2

acoder
Expert Mod 15k+
P: 16,027
It would probably be ASP.NET.

If you want to upload a file without unloading the page, you can't use the XMLHttp request object because of the binary data. For a file upload, use a hidden iframe. See an example.
Nov 10 '08 #3

rnd me
Expert 100+
P: 427
If you want to upload a file without unloading the page, you can't use the XMLHttp request object because of the binary data.
FF3 can do this for binary and text files. other browsers would be limited to doing this for text-based files only.
Nov 10 '08 #4

acoder
Expert Mod 15k+
P: 16,027
You could, but not in a normal internet environment. You'd need permissions and to change a setting in about:config, or have you got something else up your sleeve? :)
Nov 11 '08 #5

rnd me
Expert 100+
P: 427
You could, but not in a normal internet environment. You'd need permissions and to change a setting in about:config, or have you got something else up your sleeve? :)
no, ive given up on recommending that (too much follow up).
i refer to something else, something better.

i am talking about sendAsBinary .

you can grab the file content from a "browsed" file input: ex
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('myFile').files.item(0).getAsBinary();
  2.  
check out the firefox3 file input interface
Nov 11 '08 #6

acoder
Expert Mod 15k+
P: 16,027
Interesting. Thanks. I'll have a play with this. Should be quite useful once other browsers follow suit.
Nov 11 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.