开发者

Jupload with asp.net - upload confirmation problem

The problem is this simple:

I use Jupload to upload files in my asp.net web application.

I have document types like "Homework", "Quiz" and "Exam" that I need to upload a document and save them开发者_开发百科 to Document table with one of these types and the path of the file.

But since jupload doesn't know my document types, when a user uploads a document, it just posts the file content to a page I created. In that receiving page, I can know if the upload is complete but the page with the applet doesn't know that.

I tried to create a successfullyCompleted event in the receving page, tells me that the uploaded documents saved to disk but I guess, since this is just a post with the file contents, the page with the applet is still the current page that displays and no Response.Redirect is working in the event method.

I have some thoughts;

  • I can customize the applet(jupload) **But I really don't want to do that
  • I can temporarily save the documents to disk, keep their info somewhere and let the end user choose a document type after this temporary save. But, this still means that I need to get an acknowledgement from the applet that the upload is completed.

I'm all ears(or eyes here).. I'll appreciate any thoughts on that problem.

If it is a simple information I'm not aware of, I'm ready to be humiliated(:


I haven't actually used jUpload, but a quick look in one of its docs shows the following parameter for the applet that might give you what you want:

Parameter: formdata

Description: With this parameter, the name of an HTML form can be specified. If the specified form exists in the same document like the applet, all form-variables are added as POST parameters to the applet's POST request.

What you could do is have them pick the document type from a dropdown on the same page as the upload, and then it would get posted along with the file so you can process it.

The only hiccup I can see with this in relation to asp.net, is that usually the whole page is inside the form tag, which means that ALL the form fields on the page would be posted back along with your file upload. That includes the viewstate fields. Might not be a problem (you can ignore them) unless there is a lot there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜