Android Question Send file .zip with intent

Hi, I'm trying to send a .zip file with an intent, the intent opens and is able to attach the file to gmail but when I send the email it returns a gmail error and it is not sent.

intent send file .zip:
Public Sub SharedFile(FileToSend As String,SharedFolder1 As String)
    Provider.Initialize
    File.Copy(SharedFolder1, FileToSend, Provider.SharedFolder, FileToSend)
    Dim in As Intent
    in.Initialize(in.ACTION_SEND, "")
    in.PutExtra("android.intent.extra.SUBJECT",FileToSend&".zip")
    in.SetType("text/plain")
    in.PutExtra("android.intent.extra.STREAM", Provider.GetFileUri(FileToSend))
    in.Flags=1 'FLAG_GRANT_READ_URI_PERMISSION
    StartActivity(in)
End Sub
 
Attached you will find screens that represent the problem, the intent opens quietly and attaches the zip file to the email but the email is not sent producing an error
 

Attachments

  • Screenshot_20230622-100810.png
    Screenshot_20230622-100810.png
    43.2 KB · Views: 111
  • Screenshot_20230622-100916.png
    Screenshot_20230622-100916.png
    42.6 KB · Views: 112
  • Screenshot_20230622-101006.png
    Screenshot_20230622-101006.png
    100 KB · Views: 127
  • Screenshot_20230622-101014.png
    Screenshot_20230622-101014.png
    53.5 KB · Views: 125
Upvote 0

drgottjr

Expert
Licensed User
Longtime User
gmail doesn't allow .zip attachments (among others). you're welcome to try to fool gmail by changing the extension...
 
Upvote 0
Top