Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Easy Feedback Form

Easy Feedback brings detailed player feedback and bug reporting to your Unity game directly to you! · By Noah Ratcliff

How to use the attachFile

A topic by hrohibil created Feb 16, 2022 Views: 102 Replies: 1
Viewing posts 1 to 2

Hello

please assist on how to use the attachfile method. I am a non coder. 

I created a button in form and in the feedbackForm script I created the public void AttachFile. But don’t know what should be inside the method?? 

Developer

For the AttachFile method you'll need to provide some kind of file data or a path to the file to send with the report, as outlined in the documentation here. I'm not aware of any non-code ways to provide those parameters. Unfortunately, Unity also does not provide any easy way to let a player browse for files to attach. 

I did find this package that provides a file browser for Windows/Mac/Linux: https://github.com/gkngkc/UnityStandaloneFileBrowser. It also would require some code to use though.

With it, you might be able to create a script like this:

public class AttachFile : MonoBehaviour 
{
     public FeedbackForm form;
     public void GetAttachment()
     {
         var paths = StandaloneFileBrowser.OpenFilePanel("Open File", "", "", false);
         foreach (var path in paths)
         {
             form.CurrentReport.AttachFile(Path.GetFileName(path), path);
         }
     }
}


You could call the GetAttachment method from your button and it should do the rest, but I haven't tested this.