Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by user-6747 (google) · Nov 24, 2010 at 09:59 AM · fileupload

File upload from within unity

Hi,

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.

Thanks,

eb_dev

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

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())
    {
        Debug.Log(file.FullName);
    }

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.

(This code is C#, as far as i know you cannot do this with Javascript)

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image user-6747 (google) · Nov 24, 2010 at 10:40 AM 0
Share

thanks for your speedy reply $$anonymous$$aarten. With this I would have to create some sort of file selection window myself wouldn't I?

avatar image Maarten · Nov 24, 2010 at 11:13 AM 0
Share

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.

avatar image user-6747 (google) · Nov 24, 2010 at 11:15 AM 0
Share

ok great, I'll look into doing that then. Thanks again.

avatar image DaveA · Dec 10, 2010 at 11:30 PM 0
Share

Forgive me, but how is the Filestream used with the WWW object for uploading, exactly?

avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

WHY WONT IT WORK? 1 Answer

Failed to upload image over custom server 3 Answers

Upload zip file from one client to another over network 0 Answers

Uploading Unity to Website 1 Answer

How to upload a local file via the web player? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges