• 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
1
Question by knotz · May 30, 2017 at 06:15 AM · databaseuploadexternal files

Upload files to a database

I'm making an app that requires to upload a file, for example, a pdf file to a database, I'v read you can upload data from de game to a database, is it possible to do this with an external file?

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
1

Answer by Maximetinu · Jun 04, 2017 at 12:25 AM

Unity is able to handle files uploads.

In the Scripting API for WWWForm there is an example about how to send a png file by POST to a given URL. By doing this, you also must to program, for example, a php script to receive the file and upload it to the database.

You also should check the Scripting API for WWW class because both classes work together.


Anyway, I tell you that to do this in a professional manner you also need to know how to coding a secure web script using hashes and some Apache config files to block accesses from browsers, for example. It should be enough programming a MD5 test like it's done in this tutorial

Lastly, let me give you the link of two of my GitHub repos that work together, as one is a Unity Game and the other a web that stores his highscores:

  • No-Mans-Flappy-Unity. Check how the WWW scripts work, in the folder Assets/Scripts/WWW.

  • No-Mans-Flappy-web. Check the php/game-scripts folder, as there are all the URL's that will be accessed by the WWW scripts.

That's all. Now you have all the needed tools to learn how to upload a file to a database. Happy coding!

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
avatar image
0

Answer by lefinno · Jun 03, 2017 at 11:30 AM

i suggest you to write an app using any jdk or ios developement kit, cus unity is kind of a game engine, and its main purpose is for games, so, it won't provide much convenient and features for writing an app.

Comment
Add comment · Show 1 · 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 lefinno · May 30, 2017 at 06:28 AM 0
Share

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

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.

Welcome to Unity Answers

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.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Adding Score & Level to Database / Dreamlo 1 Answer

UnityWebRequest how to upload a file/gameobject 0 Answers

cannot upload APK to UDP: generic error given 0 Answers

Is it possible to open a web page inside Unity? 2 Answers

can i connect to a database using unityscript instead of C? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges