Is it possible to create a file upload input box within unity? I know it is possible to upload files using unity using the www class functions but I can't find anything for selecting a file from a local machine to then upload.
Answer by Maarten
Nov 24, 2010 at 10:16 AM
You can question all files and folders trough the following code:
DirectoryInfo info = new DirectoryInfo(@"C:\");
foreach (FileInfo file in info.GetFiles())
Then get a filestream of your wanted file using
FileStream fileStream = new FileStream("Path here", FileMode.Open);
And use that stream in your upload. Dont forget to import System.IO.
thanks for your speedy reply Maarten. With this I would have to create some sort of file selection window myself wouldn't I?
Yes you should. There is no component in Unity to do this. But it wouldnt be really hard to create one with the GUI components that are available.
ok great, I'll look into doing that then. Thanks again.
Forgive me, but how is the Filestream used with the WWW object for uploading, exactly?
Answer by Laplage726
Feb 25, 2013 at 09:32 PM
Can anyone tell me how to upload a scene file through Winscp? How should I save the file? I am having maximum trouble here.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
For troubleshooting common problems with Unity 5.x Editor (including Win 10).
To help users post good questions and use the site effectively we have posted a user guide. Please check it out.
Answers and Comments
1 Person is following this question.
Not able to Upload .ulf file in IOS license activation.
How to compile a game into a .unity3d file
WHY WONT IT WORK?
Uploading Unity to Website
How to upload a local file via the web player?