使用jQuery的多个图像上传器(Multiple images uploader using jQuery)
我想创建一个PHP代码,它将上传多个图像。 只有一件事我正在努力奋斗。 我得到了上传图像的代码,但问题是浏览器超时。 如果我想同时上传250个图像,它将开始处理它直到它将超时,因此不会上传所有图像。
我想了一会儿,我想如果我可以使用
jQuery Ajax
我可以在幕后发送图像并将它们上传到那里,也许我不会得到超时错误。 我这么想,因为一次上传1张图片不应该导致超时错误,所以如果我可以拍摄所有图片,并通过jQuery逐个发送它们上传,它可能会起作用。你怎么看? 你还有其他建议吗? 请记住,我一次可以上传100张图片,或者一次上传2000张图片。
I want to create a PHP code which will upload multiple images. There is only one thing which I'm struggling with. I got the code to upload the images and all but the problem is a timeout of the browser. If i want to upload for example 250 images at the same time, it will start processing it until it will timeout and as a result not all of the images will be uploaded.
I was thinking for a while, and I thought that maybe if I can use
jQuery Ajax
I can send the images behind the scenes and upload them there and maybe I won't get the timeout error. I thought that way because uploading 1 image at a time shouldn't cause the timeout error, so if I can take all of the images, and through jQuery send them one by one to upload, it might work.What do you think? Do you have any other suggestion? Keep in mind that I can upload 100 images at a time, or even 2000 images at a time.
原文:https://stackoverflow.com/questions/21450745
最满意答案
检查手机设置中的一件事,它可能与此有关:
转到设置 - >开发人员选项 - >在取消选中“不要保持活动”再次运行您的应用程序后,不要保留活动(如果已选中然后取消选中),希望它能解决您的问题。
Check one thing in your Phone setting, it might be related to this:
Go to Setting->Developer Options->Don't keep activities(if it is checked then uncheck it) after uncheck "Don't keep activities" run your application again, Hope it will solve your problem.
相关问答
更多-
从FirstActivity,启动nextActivity,如下所示 - startActivityForResult(intent, code); 然后在SecondActivity中,setResult() - Intent intent=new Intent(); intent.putExtra("MESSAGE",message); setResult(2,intent); ...
-
我猜你可以通过相应的设置意图标志来实现你所需要的。 我发现这些标志的最佳介绍如下 Android活动和任务系列 - 意图标志 这对我来说仍然是一个令人困惑的主题,但本文提供的Android应用程序对于快速检查不同标志的作用非常有帮助。 I guess you can achieve what you need with setting the intent flags accordingly. The best introduction to these flags I found is the follo ...
-
您应该使用startActivityForResult而不是startActivity。 在您的MainActivity中,您将收到回调 onActivityResult() 在这里,您可以获取所需的信息。 如何在Android上管理`startActivityForResult`? You should use startActivityForResult instead of startActivity. In your MainActivity you will receive a callback ...
-
删除startActivityForResult(login, AuthorizationManager.REQUEST_LOGIN); 来自您主要活动的onresume() 。 这样做,您将能够回到主要活动。 如果您不希望在活动结束后返回活动,也应该从onActivityResult删除它。 remove startActivityForResult(login, AuthorizationManager.REQUEST_LOGIN); from the onresume() of your main a ...
-
试试这个作为您的家庭活动: public void signIn(View V) { final Dialog dialog = new Dialog(HomeActivity.this); dialog.setContentView(R.layout.login); dialog.setTitle("Login"); dialog.setCancelable(false); dialog.setCanceledOnTouchOutside(false); ...
-
这是我这样做的(我在我的Activity中声明了一些静态变量): @Override protected final void onRestoreInstanceState(final Bundle inState) { // Restore the saved variables. isChartShown = inState.getBoolean("chart", false); qIndex = inState.getInt("index"); scores = inS ...
-
检查手机设置中的一件事,它可能与此有关: 转到设置 - >开发人员选项 - >在取消选中“不要保持活动”再次运行您的应用程序后,不要保留活动(如果已选中然后取消选中),希望它能解决您的问题。 Check one thing in your Phone setting, it might be related to this: Go to Setting->Developer Options->Don't keep activities(if it is checked then uncheck it) af ...
-
从每个活动返回第一个活动并重新创建第一个活动(back to first activity from each activity and recreate first activity)[2023-02-22]
您无法刷新第一个Activity因为当Activity不在前台时,线程会暂停。 另外你得到ClassCastException的原因我假设是因为你试图通过传递你当前的Context来将你的第二个或第三个Activity转换为第一个Activity 。 你应该只是刷新onResume的第一个Activity ,如下所示: @Override protected void onResume() { super.onResume(); recreate(); } 要再次启动第一个Activity ... -
当您的代码放在broadcastReceiver中时,您正在使用setResult()进行BroadcastReceiver。 如果此broadcastReceiver在您的活动中,请尝试 YourActivity.this.setResult(); 如果它不在您的活动范围内,您可能需要在broadcastReceiver中保留活动引用以进行调用 yourActivityReference.setResult(); As your code is placed in broadcastReceiver, ...
-
我检查了文档,遗憾的是GraphUser不可序列化。 你可以做的是在调用setResult之前从List转换为List: List
tmpList = new ArrayList (); for (GraphUser tmp : friendList) { tmpList.add(tmp.getInnnerJSONObject().toString()); } Intent intent = new Intent(); intent.putExtra("list", tmp ...