|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
How can I check whether a user has uploaded a BLANK FILE instead of file with some data?
Can I put this check in AJAX UPLOADER??
Please suggest.
Thanks, Sumeet
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I am not sure what you meant by a "BLANK FILE". But AJAXUploader uploads the file and hand the file over to you. It does not check or look into the file for you. Once you have the file, you can do whatever you want, move it, delete it, verify it, modify it or whatever.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
Actually, I am using VS.Net 2008 and working on EO Ajax Uploader.
Do you know how can I refer to the file which is uploaded by Ajax Uploader? I want to know this so that I can check for its length/number of characters in the file.
Please suggest.
Thanks, Sumeet
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
Thanks for the material, however as per my requirements, I need to restrict the user from uploading an empty file (file without any data inside). As mentioned in the documents, I can check the file uploaded on the form submit, however I want to check the file data before submit so that I can restrict the form to submit. My form should submit only if file contains some data inside it.
How do I achieve this? can you please suggest?
Thanks, Sumeet
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
In order to prevent user from submitting empty files, you will need to check the file contents on the client side. By default, no browser will allow a Web page to check files on the client side. Otherwise anyone can write a page and as soon as they lure you to visit their page they will be able to sneak whatever that’s on your computer. You can use ActiveX Plug-in/Java Applet to get around this but then your code has to be digitally signed and user has to accept your digital signature and agrees to give you the permission you requested. And the code will fail if user choose deny.
Our AJAXUploader is a 100% DHTML/JavaScript solution. So it does not go beyond the default browser permission. Thus AJAXUploader will not be able to check the files for you before submitting.
Hope this clears up.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 8/4/2009 Posts: 9
|
Hi,
Can AjaxUploader count the number of charaters in a file which is still in templFile location??
If yes, then can you please provide me with some code example?
On page submit, how I can handle the file uploaded by AjaxUploader? Some code snippets would be helpful.
Thanks,
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
AJAXUploader does the following:
1. Transfer the file from the client to the server as a temp file; 2. Give you the temp file name; 3. Optionally, move the temp file to a final location for you;
When you want to check on the files, you usually skip step 3. So the uploader gives you a temp file name and you do whatever the rest. You can delete the file, copy the file, or count whatever in the file, it's totally up to you. The key is, AJAXUploader transfers the file to you, you process the file.
Please see the previous documentation links on how to handle file uploaded by the uploader as well as how to get the temp file name. It already has the sample code.
Thanks
|
|