Search Unity

Question Error in DownLoadHandlerFile

Discussion in 'Scripting' started by danchavil, Sep 26, 2022.

  1. danchavil

    danchavil

    Joined:
    Jul 12, 2018
    Posts:
    32
    Hello everyone!!!

    I try to download an asset bundle from a web server because I need to save all the AssetBundles on my local PC. First of all, I save all the links of the asset bundles in a firebase, after I consult the firebase try to download the asset bundle with the following code:

    Code (CSharp):
    1.     IEnumerator DownLoadAssetBundle(cars _car)
    2.     {
    3.         UnityWebRequest request = UnityWebRequest.Get(_car.ModelURL);
    4.  
    5.         request.downloadHandler = new DownloadHandlerFile(urlFolder);
    6.  
    7.         yield return request.SendWebRequest();
    8.  
    9.         if (request.result != UnityWebRequest.Result.Success)
    10.         {
    11.             Debug.Log(request.error);
    12.         }
    13.         else
    14.         {
    15.             Debug.Log("saved in " + urlFolder);
    16.         }
    17.  
    18.     }
    but when I try to test it, Unity gave me the following error:


    ArgumentException: Failed to create file E:/Unity Projects/Firebase/Builds
    UnityEngine.Networking.DownloadHandlerFile.InternalCreateVFS (System.String path, System.Boolean append) (at <22cd8f01dc1543789c8f26f4546673cc>:0)
    UnityEngine.Networking.DownloadHandlerFile..ctor (System.String path) (at <22cd8f01dc1543789c8f26f4546673cc>:0)
    TestGet+<DownLoadAssetBundle>d__7.MoveNext () (at Assets/Scripts/JsonFirebase/TestGet.cs:56)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <c62cc0ef748e4107b21e2999fa50d73a>:0)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    <GetCoroutine>d__6:MoveNext() (at Assets/Scripts/JsonFirebase/TestGet.cs:47)
    UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)


    I close my antivirus (sometimes my antivirus gives me some issues), and y put the HTTPS in the link, but don't solve the error. I don't know what happens.

    I hope someone lets me know where is the error.

    thanks and regards

    UPDATE

    The issue was solved. But I have a new one. When I try to download it from the HTTP didn't works, i can't se the copy of the file, but when i try with the HTTPS appear the next issue:


    Curl error 60: Cert verify failed: UNITYTLS_X509VERIFY_FLAG_USER_ERROR1

    SSL CA certificate error
    UnityEngine.Debug:Log (object)
    TestGet/<DownLoadAssetBundle>d__7:MoveNext () (at Assets/Scripts/JsonFirebase/TestGet.cs:61)
    UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)


    some one could help me please :'(
     
    Last edited: Sep 26, 2022
  2. danchavil

    danchavil

    Joined:
    Jul 12, 2018
    Posts:
    32