Welcome Guest Search | Active Topics | Sign In | Register

AJAX Uploader Options
Richard
Posted: Wednesday, June 9, 2010 11:36:31 AM
Rank: Newbie
Groups: Member

Joined: 1/26/2010
Posts: 3
Hi

I'm trying to use the AJAX Uploader to store files in a database.

What I don't want to have to do is store the files in a temporary location first, but it seems thats the only way this control works.

Is there any way to use the AJAX Uploader so that I can collect the posted file bytes and write them directly to the database without first having to store the file in a temporary location?

Thanks in advance for your assistance.

Richard
eo_support
Posted: Wednesday, June 9, 2010 11:50:46 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Richard,

The control always put the content in temp file first. That is how it SHOULD work. Otherwise your can run into locking problems because it can take a while for user to upload the file. For example, if it takes 5 minutes for a user to upload a single file, then your two options are:

1. Lock your db row through out 5 minutes so that nobody can read the row that you are updating;
2. Do not lock your db row so that other people can read the row while you are updating;

Neither would work. Option 1 will kill your app instantly. Option 2 will result in dirty read.

You don't need to worry about deleting the temp files. They are automatically cleaned up by the uploader.

Thanks!
Richard
Posted: Wednesday, June 9, 2010 12:08:29 PM
Rank: Newbie
Groups: Member

Joined: 1/26/2010
Posts: 3
Ok

Thanks for getting back to me.

The problem is that I am hoping to develop an application using the control but for which I might not be able to configure permissions on folders on the server such as to allow AJAXUploader to temporarily store files.

The nature of the application is such that I do not believe locking would be an issue, since access is time controlled and upload of new material would be limited to outside of this time.

However, from your reply, it does not look as thought the AJAXUploader is the control I need, because it does not allow me to capture the posted file bytes[] from the control itself in the same way that the asp.net FileUpload control does.

Do you have any further thoughts on how I might achieve this using the AJAXUploader?

Thanks
eo_support
Posted: Wednesday, June 9, 2010 12:34:33 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi Richard,

In that case you probably want to use standard ASP.NET FileUpload. The most distinctive feature of our uploader is that it streams uploaded data into temp file. The biggest problem for ASP.NET FileUpload is that it stores all received data in a byte[] so not only it can't handle big files, but also consumes too much memory and can run out memory and crash very quickly when multiple users are uploading. Our Uploader on the other hand always uses a fixed size buffer no matter how big the file is because it just keep writing into a temp file.

We have never had users complaining about not being able to have a writable folder on the server though. Frankly speaking if you don't have a writable folder on the server, then what your app can do is severely limited. For this reason almost all hosting companies would give you write permissions, or at least write permissions on a specific folder. However if you can not have a writable folder, then I can confirm that the uploader will not work for you.

Hope this clears up. Please feel free to let us know if you still have any question.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.