Search The ForumSearch   RegisterRegister  LoginLogin

MailBee POP3

 AfterLogic Forum : MailBee POP3
Subject Topic: One files isn’t save Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
noamway
Newbie
Newbie


Joined: 24 May 2007
Online Status: Offline
Posts: 15
Posted: 27 May 2007 at 6:35pm | IP Logged Quote noamway

When I save the files in the email, I do something like that:
Code:

For i = 0 To Attachments.Count - 1

     Set at = Attachments(i)

     fileNameTXT   & nbsp;      =  at.Filename

     .
     .
     .
     .

Next


The problem is that if I send more then one file he sometimes don't appear.
The most strange things that sometimes the first file save twice.

Do you know something about that?
(All the files have names and I check to see if someone don't have and I don't get any error about that)

This is my full code:
Code:

Set Attachments     = objMsgs.Attachments
Set fs = CreateObject("Scripting.FileSystemObject")
For i = 0 To Attachments.Count - 1

     Set at = Attachments(i)

     fileNameTXT   & nbsp;      =  at.Filename
     If fileNameTXT<>"" Then
           FileExt          ;      =  Right(fileNameTXT, Len(fileNameTXT) - InStrRev(fileNameTXT, "."))
           FileExt          ;      =  LCase(FileExt)
           'check if the file exist if Yes, change is name
           fileNameTXT   & nbsp;      =  CheckFileOverright("image/bizzzzz", fileNameTXT, FileExt)
           fileSizeNUM        & nbsp; = at.Size
           pathFileTXT        & nbsp; = fs.GetAbsolutePathName(server.mappath("/image/bizzzzz/"))


           If at.SaveFile(pathFileTXT, fileNameTXT) Then
                response.write  "File: "&pathFileTXT&"\"&fileNameTXT&" saved<br>"
           Else
                response.write  "I/O Error<br>"
           End If
     Else
           response.write "File name nonexisting<br>"
     End If
Next
set fs = Nothing
set Attachments = Nothing
Back to Top View noamway's Profile Search for other posts by noamway
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 May 2007 at 4:08am | IP Logged Quote Andrew

Collections in VB6/ASP are indexed from 1, not from 0. So, we fixed the following line in your code:

Code:
For i = 0 To Attachments.Count - 1


to:

Code:
For i = 1 To Attachments.Count


or even better to:

Code:
For Each at in Attachments


and tested it with some messages containing attachments. It works fine.

Please apply the same fix in the source code of your application. If it doesn't help, please provide us with the e-mail message which causes the issue. You may save it as .eml file and attach to your reply in Request Support Form.


Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
noamway
Newbie
Newbie


Joined: 24 May 2007
Online Status: Offline
Posts: 15
Posted: 28 May 2007 at 6:31pm | IP Logged Quote noamway

Again!!!!

You jest great.

good product & good suuport. perfect!
Back to Top View noamway's Profile Search for other posts by noamway
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide