iOS Question Error opening stream? "Operation not permitted"

Nicolás Cieri

Active Member
Licensed User
Hi!, I'm trying yto get the base64 of video.

I get the follow error in this line:
****Dim g As InputStream=File.OpenInput(VideoPath, fileName)****

Error opening stream (/private/var/mobile/Containers/Data/PluginKitPlugin/54F3DF87-C8A6-4688-87F2-3E92272ACEF0/tmp/trim.C3C22472-753B-4A28-BC41-3CB3B366D962.MOV): Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={_kCFStreamErrorCodeKey=1, _kCFStreamErrorDomainKey=1}


B4X:
Sub Cam_Complete (Success As Boolean, Image As Bitmap, VideoPath As String)
    If Success Then

        VideoPlayer1.LoadVideo(VideoPath,"")
        
        Wait For VideoPlayer1_Ready (Success As Boolean)
        If Success Then
            VideoPlayer1.Play 'to start playing automatically
            
            Dim ps() As String = Regex.split("/", VideoPath)
            Dim fileName As String =(ps(ps.Length-1))
            Dim path As String =""
            For i = 0 To ps.Length-2
                path = path & ps(i) & "/"
            Next
            
            Dim p As StringUtils
            
            VideoPath= VideoPath.Replace(fileName,"")
            
            Log(VideoPath & "      " & fileName)
            
            
            Dim g As InputStream=File.OpenInput(VideoPath, fileName)
            
            Dim b() As Byte = Bit.InputStreamToBytes(File.OpenInput(VideoPath, fileName))
            Dim b64As String = p.EncodeBase64(b)
          

    End If
End Sub
 

Nicolás Cieri

Active Member
Licensed User
Also I tried with this mode
sendfile.PostFile(url, VideoPath, fileName)

But I get...


Error getting attributes: Error Domain=NSCocoaErrorDomain Code=257 "The file “trim.FFFA45DF-0449-41E5-BDD7-AA339607A2A6.MOV” couldn’t be opened because you don’t have permission to view it." UserInfo={NSFilePath=/private/var/mobile/Containers/Data/PluginKitPlugin/54F3DF87-C8A6-4688-87F2-3E92272ACEF0/tmp/trim.FFFA45DF-0449-41E5-BDD7-AA339607A2A6.MOV, NSUnderlyingError=0x283ef8ff0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
 
Upvote 0

Nicolás Cieri

Active Member
Licensed User
Yes.. select and play yes!!.. the problem is later

I can see the video on my app, but when I try the OpenInput or the PostFile, I get this error
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…