Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Nodirbek  
#1 Posted : Wednesday, July 4, 2007 11:46:59 PM(UTC)
Nodirbek

Rank: Member

Groups: Member
Joined: 6/18/2007(UTC)
Posts: 5

Hi there,
I need a way to trigger my own function on server side upon successful completion of image upload. ( I am using Applet version)
Because, when the user uploads, they are first uploaded in a Temporary folder.
Once upload is finished, I need to move all the images from Temporary folder to actual place where they should be stored with some processing.
So, is there any possibility I can handle the event of successful upload.

I would be really thankful receiving your reply.

never say never
Alex Makhov  
#2 Posted : Thursday, July 5, 2007 9:47:20 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

You could change the upload processing script to save files anywhere you want. Just get some of Image Uploader samples and modify any upload processing script. Standard Image Uploader sample upload processing scripts save uploaded files to the Gallery folder but you could change it to store your files anywhere.
Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Nodirbek  
#3 Posted : Friday, July 6, 2007 5:04:29 AM(UTC)
Nodirbek

Rank: Member

Groups: Member
Joined: 6/18/2007(UTC)
Posts: 5

Actually my current implementation is the same as in the example.
Can I have your attention for my current problem I am facing:
1. User uploads say 100 images and popup window comes up "Successfully Uploaded"
2. On the server side, images are not stored directly to working folder ("OUTBOX"), but in a temporary folder ("TEMP").
Because, there is another system which checks OUTBOX every second, if there are new images it will process them.
But when the user is uploading 100 images, it might happen that only 50 images have arrived yet, and the processing system
will process only those 50 images in a one shot, which is quite wrong as for me.
That's why I am using TEMP folder to ensure atomicity, i.e. either all 100 images are visible to the processing system, or
none is.
3. So, at this point images are in TEMP folder. But the user has already seen the "Sucessful upload" message
and he thinks that his images are permanent on the server.
4. When he clicks "OK" on popup window, I redirect him to my own page,
Where I move files from TEMP to OUTBOX to make them visible for the processing system.

But as you see, my ultimate function is not triggered unless the user clicks "OK" on popup window.
It happened that some of my users after seeing the "Sucessful upload" message, then didn't click "OK" button
They just simply left browser open or just closed it, which means, his images left on TEMP folder
and were not copied to OUTBOX.

In my opinion, my problem can be solved if you have some thing like "OnSuccessfulUpload()" trigger
where I can specify my own url action "http://....../moveImages.aspx?id=99".
So, when files are successfully uploaded to server, it will perform my url action, and then will show
"Successful Upload" message to user

I do appologize for stating you long description of my problem.
Will appreciate your suggestion
never say never
Alex Makhov  
#4 Posted : Monday, July 9, 2007 1:45:54 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Sorry for the long delay.
Please, read the following article: POST Field Reference.
As far as I understand you need to know when upload script works for the last time. I mean you are using the one file per one package upload (FilesPerOnePackageCount=1 or = 2 or smth like that) and want to know when upload processing script is called at the last time. So you could use the PackageIndex and PackageCount fields to check if the current upload processing is the last so here is a pseudocode:
Code:
if (PackageIndex == PackageCount - 1)
{
	fireUploadDone();
}

Edited by user Wednesday, October 29, 2008 12:13:25 PM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Forum Jump  
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.