For security reasons, ajax doesn't support file uploads. To get close to the
same effect, consider posting to a hidden iframe or flash for your file
uploads.
HTH,
Shaun
ISSSSI wrote:
>
> Guys,
>
> I am having a problem doing ajaxform post. I have form
>
> <form id="main" enctype="multipart/form-data" method="post">
>
> also I have file input
>
> <input type="file" id="feature1File" title="jpg file to upload"/>
>
> my jquery code looks something like this
>
> var options = { url: 'asp/main.asp?Method=UploadFile', after:
> uploadImage
> };
>
> $('#main').submit(function() {
> // submit the form via ajax
> $(this).ajaxSubmit(options);
> // always return false to prevent standard browser submit
> return false;
> });
>
>
> The form submits and goes to target page but nothing is uploaded. when i
> do normal submit post without jquery the file is uploaded. Anyone any
> ideas suggestions??
>
> For brevity my asp upload code looks something like this
> If Request.TotalBytes > 0 Then
>
> Set objUpload = New vbsUpload
> For lngLoop = 0 to objUpload.Files.Count - 1
> 'If accessing this page annonymously,
> 'the internet guest account must have
> 'write permission to the path below.
> objUpload.Files.Item(lngLoop).Save IMAGEDIR
> Response.Write IMAGEDIR & "\" & objUpload.Files.Item(lngLoop).FileName
> Next
>
> Else
> Response.write("Error: nothing to upload")
> End if
>
> It looks like a proper post is not being done?
>
--
View this message in context:
http://www.nabble.com/ajax-file-upload-tf2653865.html#a7405087
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/