0

i have a huge value. i need to pass that huge value to one page to another page using form.

<form name="ss" method="post" enctype="multipart/form-data">
<input type="text" name="huge_value" value="<?php echo $huge_value;?>" />
<input type="submit" name="submit" value="submit" />
</form>

The Huge value is canvas base64 encoded image. I need to convert this image and Download that image. so only i pass that value to another file.

My script working well in localhost. when i upload the file into server the huge post value take minimum 8 min to 10 min time for conversion and download.

My huge data example is given below

$mainarrattt = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAACvAAAArwCAYAAAB4iu5YAA..................'

I have also increase POST_MAX_SIZE in phpini. but same issue.

How can reduce POST loading time in server. Please help me.

Updated

I have also increased memory_limit

Please ask me how to send very large value using post

Padmanathan J
  • 4,614
  • 5
  • 37
  • 75

5 Answers5

1

You can increase the limit in your php.ini file

memory_limit = 64M
Ranjith
  • 2,779
  • 3
  • 22
  • 41
0

There are many factors that could be contributing to this: network, speed of the server, resources available to PHP, etc. Start out by decorating your script with some calls to collect timing and see what part of it is taking the longest. There are a couple of different ways to go about this over at this question

Community
  • 1
  • 1
Paul Degnan
  • 1,972
  • 1
  • 12
  • 28
0

It sounds like it's not a server side issue. You probably want to try to reduce your image size before sending. You could use canvas.toDataURL('image/jpeg', 0.5); the second parameter will reduce quality and should reduce the file size.

Steve Parish
  • 1,824
  • 2
  • 14
  • 12
0

I suppose you can use some compression on the http server, which is probably the case if you use a hosting provider.

You can also determine what exactly causes the delay using chrome of firefox (or opera...) developer toos to see the network timing.

For php timing consider using

$then = microtime();
  //put the post functions here
  theTestedFunction();
  anotherTestedFunction();
$now = microtime();
echo sprintf("Elapsed:  %f", $now-$then);
user1328370
  • 401
  • 1
  • 3
  • 6
0

8-10 minutes is a long time for "just" a 5mb file to be encoded and uploaded to a dedicated server.

Your problem might be the kind of server hosting you're using which you say is VPS.

"VPS" and "dedicated" don't usually go together.

VPS indicates your app is running on a server that also runs other apps.

Your server is "dedicated" -- but only for a small period of time.

A VPS server:

  • works on your app for a small period of time
  • stops working your your app
  • works on a totally different different app for another small period of time
  • and finally reloads your app and re-starts working on it.

You might need to buy more time-slices for your uploading to complete in a reasonable time.

markE
  • 102,905
  • 11
  • 164
  • 176