upload a file with php and AIR

24 sec read

Let’s say you want to upload a file to your server with your AIR program (using File.upload). On the server side you have a php script to handle the file uploading. A very common mistake is that the name of the file field in your AIR (by default, it is “Filedata’) is different from that in your php script. Your php script should be something like this:

if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $foldername))
{
    print "success";
}
else
{
    print "fail";
} 

Of course, you can always specify your own file field name in File.upload (2nd parameter)
File.upload(request:URLRequest, uploadDataFieldName:String = "Filedata", testUpload:Boolean = false):void



写作助手,把中式英语变成专业英文


Want to receive new post notification? 有新文章通知我

How much money did I make from an app?

Undoubtedly some people are very successful in making money by developing a smartphone app. Back in 2012 I developed an app called “Handbook of Brain” which is a collected resources of brain anatomy, function and diseases. I put the app i
Xu Cui
27 sec read

Handy programs to visualize NIRS data (2): plotTopoMap

Often you need to view the spatial pattern of activation as in the example below. plotTopoMap allows you to do that. It probably only works for Hitachi devices where the spatial relationship between channels are known. In the above example, the activ
Xu Cui
37 sec read

Flash 3D video demo

Racer Ostrova Zombie
Xu Cui
0 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *