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.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
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?
Failed to upload image over custom server
Uploading Unity to Website