You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently for each UnityWebRequest the DownloadHandlerBuffer are used.
See the extension class
In my unity project i has to download large files (>100mb) to a file on the pc or device.
With the byte buffer download handler the whole content of the file was loaded into the ram and when the download was finished the content can be written to the local file.
For these large files it would be nice to set a download handler manualy to the RequestHelper like this:
stringsrcUri="http://myapi/ressource/load/bigfile";stringdestPah= Path.Combine(Application.persistentDataPath,"bigfile");DownloadHandlerFiledh=new DownloadHandlerFile(destPah);
dh.removeFileOnAbort =true;
Proyecto26.RequestHelper request=new Proyecto26.RequestHelper(){Uri=srcUri,DownloadHelper=dh,};
Proyecto26.RestClient.Get(request).Then(()=>{ Debug.Log("Downloaded to "+destPah);}).Catch(err =>{ Debug.Log("Error during download:"+err);});
In the extension class the options can be checked like this:
if(options.DownloadHelper is DownloadHandler)
request.downloadHandler = options.DownloadHelper;else
request.downloadHandler =(DownloadHandler)new DownloadHandlerBuffer();
To add the download helper to the request helper the request helper needs to become the download helper property like this:
Currently for each
UnityWebRequest
theDownloadHandlerBuffer
are used.See the extension class
In my unity project i has to download large files (>100mb) to a file on the pc or device.
With the byte buffer download handler the whole content of the file was loaded into the ram and when the download was finished the content can be written to the local file.
For these large files it would be nice to set a download handler manualy to the RequestHelper like this:
In the extension class the options can be checked like this:
To add the download helper to the request helper the request helper needs to become the download helper property like this:
There are a lot of useful download helpers out there. Like AssetBundle or Texture, ....
It wold be nice when you can add the support of a configurable download helper.
My currently workaround is to perform the web request by myself without your RestClient (without all the features and much more code).
The text was updated successfully, but these errors were encountered: