send really large files to server via flash/air application - actionscript-3

i've been searching for the answers for a day or two and i still don't know how to approach this problem.
i want to make an application to upload really large files to a server. i've decided to go for the adobe air because i thought it would be less restricting than flash, anyways, i am using actionscript3.
if i wanted to use a regular file uploading class i meet a server restriction of max file size (i tried working with php).
i googled something about "chunked fileupload" where i send small amounts of 64bit encoded data to a server via urlloader class and then merge them in php. this, however, creates a massive extra upload size overhead (because of the 64bit encoded data).
another idea i read about is to use a "socket connection" send a direct tcp stream. however, i have absolutely no idea how do sockets work and what should i use as a server. i tried using some simple php socket example code found online but i didn't really understand how would i use this for fileupload and flash didn't want to connect to it anyways. maybe someone could enlighten me on that?
or maybe someone has a better experience in the chunked fileupload method? is there an already existing library for handling large fileuploads in actionscript?
really ANY advice would be appreciated, i feel kind of lost in my quest.
i do have control over the server to some extent maybe i will convince sysadmins to install some service for me.

Related

How to read from a database, add some of that information to html, and send that html to a user?

I'm designing a website where users can upload comments on pages, and other users should see those comments. I reached the stage where I have the comments stored in a database, and I know the place they're supposed to go in the html, and I need to connect those two things somehow.
I'm using express and Node.js on the server side, and postgres on the db side.
As of when I'm asking this, it seems to me it's very bad practice to have the user access the database. So I think the server needs to access the database based on the user's request, modify the generalized html's showing of comments to now have the information of the specific comments, save that to a file, and send it to the user. To do this I was thinking of creating an "html generator function" on the server-side that takes in specific comment information and puts it in the generalized html, but that seems like it doesn't scale well and I'm concerned that storing the intermediate file would be inefficient.
Is that the correct approach? Can you tell me known ways of doing this that aren't so hacky?
If you suggest using php, isn't there a problem where php connects to a server and disconnects every time we use it? I would prefer if the server connected once when it booted and did all the fetching when needed instead of connecting every time. It seems to me like that would involve far less overhead (correct me if I'm wrong...)
See the comment of Amadan for the full solution. It's called a "template engine"
Edit:
I highly recommend learning React. I learned EJS and it's difficult to scale. React is infinitely easier to program with for just a little more investment. The old web is much less declarative (& EJS is much less too).

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.

HTML5 Localstorage to Remote storage query

I have created a HTML5 webapp that runs quite nicely on most smartphones. Program can accept input from a user, store the information, display it, edit it, delete etc. Works fine.
I was wondering if there is yet a standard way fo sychronising this information with a remote MYSQL server, heck at this point I would settle for being able to post the information directly to a remote server, completely skipping localstorage.
I have looked at the websqlsync on github, but having limited success getting it working.
Any guides, working examples, tutorials or general pointers or best practice at getting html5 localstorage onto a MYSQL server greatly appreciated.
Why don't you save the localStorage object as a JSON string, and pass that to the remote server? What do you want to do with the data on the server?

Sync database on ipad with remote database

I have an ipad app that has a database. I created a web-service on my mac mini using php,apache,mysql.
What I would like to do is sync the database on the ipad with the one I have on the remote computer maybe once everyday. Can someone please provide me with an example,sample code or even advice on how to go about doing this?
I would need more info to give you an accurate answer. What kind of database are you using ?
I can only give you a general answer since you really don't provide a lot of info,
What you would usually do when you need to send/request data from iOS to a Web Service, is send an HTTP Request using NSURLConnection or other wrapper classes such as AFNetwork.
Also the term "syncing" is quite a big subject, what do you mean by syncing? Always making sure the data on the iOS Database is the same as the web service database? If so you could have the client save some sort of E-Tag (last modified date), and ask the server only for data from that day onwards. Or the other way around, depends on the type of syncing you wish to accomplish.
I hope some of this makes sense for you, since your question was really general, my answer features a bit of general info , but might be helpful for you :)

Desktop programming language to connect to remote MySQL

A customer of mine asked me a better and faster solution to update it's real estate web site as he and his employees don't want to connect to the web site and update one by one the ads as they don't want to loose time waiting the normal latency of the internet.
I firstly solved the issue by building a PHP script that imported an Excel file into the web site's MySQL database and it worked greatly. But the problem were pictures that have still to be uploaded separately. I then wrote a PHP script that uploaded the pictures using ajax and drag&drop so the user could select multiple pictures and upload them at once. And this worked too, but the customer is still not completely satisfied as he says this solution is quite 'patched'.
I then thought about a desktop application - a kind of local database (could be SQLite) - that the user keeps updated locally and only at the end of the day the app connects to the remote server and updates the db and uploads the pictures.
My question is: what EASY desktop high level programming language I could use to do the job? Do you know any RAD (visual IDE) programming language able to connect to a remote mySQL server and upload data via a simple custom GUI?
I tried RealBasic and PureBasic but I did not work it out. I thought about building the app in PHP and then convert it to EXE but I did not tried yet.
Please don't suggest me Java, C or Delphy as I'm looking for something very easy.
Thank you
Have you considered a client side javascript/html app that syncs with the server, since you're already familiar with the platform? If one browser better supports what you want to do (Firefox has some extension perhaps vs Chrome, or whatever), than mandate that to run this app (rather than worrying about being portable across browsers).
All of the browsers can have client side storage now, and you can just do things locally, and finally push them to the server "all at once".
If your client is using a Windows platform, you could use IronPython (.NET), VB.NET, or C#. These all allow you to create windows/forms visually in Visual Studio. If you're not already familiar with the .NET platform I'm not sure how 'easy' this will be, but I think that's going to be true for most other platforms as well.
That being said, it sounds like your existing solution is probably the best idea - perhaps if you can make your solution feel less like a "patch" they will be satisfied.
No reason you can't use Purebasic if that's what you're comfortable with. There are HTTP file upload examples on the PB forums.
I've used Purebasic for years but I'd recommend spending the time to get to know C#/.NET - it's a world of difference and once you learn it stuff like this is pretty easy.