solynaseng
Forum Replies Created
-
Hello,
I am trying to upload 40 images using wp ajax.
After uploading 10 ~ 11 images, remains do not upload.
Now, only one plugin is activated. This is ListinPro Plugin.max_execution_time?
I increased max_execution_time to 300 on wordpress .htaccess file.But it is same.
Here are some codes.
// reading data from xml file
while ($valid) {
$default = simplexml_import_dom($reader->expand($doc));
$googleBase = $default->children(‘http://base.google.com/ns/1.0’);
$title = $googleBase->title;
$image_link = strtok($googleBase->image_link, ‘?’);
$price = $googleBase->price;
$sale_price = $googleBase->sale_price;$image = “”;
if($image_link != “”) {$file = array();
$file[‘name’] = $image_link;
$file[‘tmp_name’] = download_url($image_link);if (is_wp_error($file[‘tmp_name’])) {
@unlink($file[‘tmp_name’]);
var_dump( $file[‘tmp_name’]->get_error_messages( ) );
} else {
$attachmentId = media_handle_sideload($file, 0);if ( is_wp_error($attachmentId) ) {
@unlink($file[‘tmp_name’]);
var_dump( $attachmentId->get_error_messages( ) );
} else {
$image = wp_get_attachment_url( $attachmentId );
echo $image;
}
}
}
// move to next item element
$valid = $reader->next(‘item’);
};Would you help me?
- This reply was modified 8 years, 12 months ago by solynaseng.