Author |
|
noamway Newbie
Joined: 24 May 2007
Online Status: Offline Posts: 15
|
Posted: 27 May 2007 at 6:35pm | IP Logged
|
|
|
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 |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 28 May 2007 at 4:08am | IP Logged
|
|
|
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 |
|
|
noamway Newbie
Joined: 24 May 2007
Online Status: Offline Posts: 15
|
Posted: 28 May 2007 at 6:31pm | IP Logged
|
|
|
Again!!!!
You jest great.
good product & good suuport. perfect!
|
Back to Top |
|
|