|
Rank: Advanced Member Groups: Member
Joined: 8/27/2007 Posts: 44
|
Hello again,
One more question. After uploading a file using AjaxUploader, I have an .INFO and .STATUS file remaining in the upload directory. Shouldn't these be automatically cleaned up ? Or if I need to delete these manually, what's the best practice ?
(I tried to search for already existing info on the forum, but the search did seem to work ?).
The code handling the upload is:
If Me.AJAXUploader1.PostedFiles.Length > 0 Then Dim AllowedMimeTypes As String = "audio/x-mp3,audio/mpeg" If AllowedMimeTypes.Contains(Me.AJAXUploader1.PostedFiles(0).ContentType) Then Dim Filename As String
Select Case Me.drpUploadTrackType.SelectedValue Case "Sample" Filename = "D:\Sites\Passacaille\Upload\Samples\" & Me.gvTracks.SelectedValue & ".mp3" Case Else 'full Filename = "D:\Sites\Passacaille\Upload\Tracks\" & Me.gvTracks.SelectedValue & ".mp3" End Select If System.IO.File.Exists(Filename) Then System.IO.File.Delete(Filename) System.IO.File.Move(Me.AJAXUploader1.PostedFiles(0).TempFileName, Filename) Me.AJAXUploader1.ClearPostedFiles() Me.gvTracks.DataBind() Me.lblUploadTrack.Visible = False Else Me.lblUploadTrack.Text = "only .mp3 files are allowed" Me.lblUploadTrack.Visible = True End If End If
Best Regards, Alexis
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Don't worry about those. AJAXUploader runs a sweeper and clear those files in the background. They will eventually be cleared automatically.
|
|
Rank: Advanced Member Groups: Member
Joined: 8/27/2007 Posts: 44
|
OK, but can you tell me how at when the sweeper should run ...the leftovers are from uploads that were done 2 days ago ...
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hum...the sweeper runs more often than that. There is one scenario that I can think of that can drag this long:
1. You run the app, upload some files, this leaves .info and .status file; 2. You close out your app before the sweeper gets a chance to clean up; 3. You run your app again, but no longer use AJAXUploader. The sweeper will only be activated when the app uses the uploader;
The the least extend, these temp file should not accumulate, and we never had any report that they do. So I would keep an eye on them to see if that happens. If it happens let us know and we will take a look.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 8/27/2007 Posts: 44
|
Well, they seem to accumulate ... even if the user is performing several uploads after each other in the same or later sessions, and also still using AJAXUploader ... Do you need me to post the aspx code as well ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
It would be easier if we can see it on your machine. I've set up an online meeting for you. You mind to join? I've sent the link to your private messages.
|
|
Rank: Advanced Member Groups: Member
Joined: 8/27/2007 Posts: 44
|
Sorry, I didn't saw the link for the online meeting in time ... and now it is expired ... can you send it again ?
|
|