Hello, when im upload more than a one image, web show me this error: Validation error, please try again. If this error persists, please contact the site administrator. I cant go to next step.

You know how to fix this?

Comments

ceskaondra’s picture

Error is probably already set in the module because it conflicts with the cache settings of life, if none, everything works ok, but when it set as 1 minute, so it complains about this problem ... I can resolve this issue on their Web sites, too If it would be necessary for the module could somehow disable the cache altogether .... but I do not know.
It probably will want some other version of the module ...

jen.c.harlan’s picture

I am now getting a validation error about half the time when I only try to upload one image and every time when I try to upload more than one image.
Also the "Please wait until all images are processed" keeps refreshing over and over endlessly until I reload the page. When I try again, sometimes it works and sometimes it doesn't, but the refreshing continues again until I reload again.

gkazhus’s picture

same problem here

gkazhus’s picture

Is this solved or not?

patkai’s picture

Same here, with some even more weird behavior: all the files are always uploaded to the tmp directory, but only a few of them are moved to the image-gallery. When I navigate elsewhere and try to create a new image gallery the files that haven't uploaded to the previous gallery are also added to the beginning of the queue, so the galleries are mixed! Pretty bad... :)

kenneth001’s picture

same problem i can upload about 3 image without problem if i do more then i get the same validation error

patkai’s picture

couldn't solve this, but swfupload works like charm.

kenneth001’s picture

i solved the problem it has to do with cache so go to administer-> performance and make sure the minimum cache lifetime is set to none save configuration and try upload multiple pictures it should work thats what i did and it work for me. let me know if this works or not

ceskaondra’s picture

Reactions to confirm the number 8, you need to have the cache lifetime is set to none, it can also be adjusted by inserting the function fupload_filetransfer () in the source code file image_fupload.module, and have the function variable_get ('cache_lifetime',''), and then right in the file in the same position but at the very end of the turn function variable_set ('cache_lifetime', '21000 '), where the number is 21,000 minutes, setting life.
So it might look like this:
==========================================
function fupload_filetransfer() {
// huh.. swfUpload sends some data...let's see
global $user;
variable_set('cache_lifetime', '');
$sid = $_POST['PHPSESSID'];
$node_type = check_plain($_POST['nodetype']);
$field_name = check_plain($_POST['fieldname']);

// validate given session id
$result = db_query("SELECT * FROM {sessions} WHERE sid = '%s' AND hostname = '%s' LIMIT 1", $sid, ip_address());
$upload_user = db_fetch_object($result);
// Get users profile
$user = user_load(array('uid' => $upload_user->uid));

// Do some checks before upload
$field_access = FALSE;
if (!empty($upload_user) && !empty($node_type) && !empty($field_name)) { // user valid? node_type & field_name received?
// Check if given node_type & field_name combination is possible for user
switch ($node_type) {
case "image":
// image node type
if ($field_name == "images") {
$field_access = node_access('create', $node_type, $user);

// get suitable validators for our upload: image module
$validators = array(
'file_validate_is_image' => array(),
'file_validate_size' => array(variable_get('image_max_upload_size', 800) * 1024),
);
}
break;
default:
// probably cck image node type
if (module_exists('content')) {
if (image_node_type_load($node_type, TRUE) && ($field = content_fields($field_name, $node_type))) {
$field_access = node_access('create', $node_type, $user);

// also get suitable validators for our upload: cck imagefield module
$validators = array_merge(filefield_widget_upload_validators($field), imagefield_widget_upload_validators($field));
}
}
break;
}
}

if (user_access('mass upload images', $user) && $field_access) {
// Adapt to drupal files structure
$_FILES['files']['name']['image'] = $_FILES['Filedata']['name'];
$_FILES['files']['type']['image'] = $_FILES['Filedata']['type'];
$_FILES['files']['tmp_name']['image'] = $_FILES['Filedata']['tmp_name'];
$_FILES['files']['error']['image'] = $_FILES['Filedata']['error'];
$_FILES['files']['size']['image'] = $_FILES['Filedata']['size'];

// do some checks via transliteration module if available
if (module_exists('transliteration')) {
require_once(drupal_get_path('module', 'transliteration') .'/transliteration.inc');
$_FILES['files']['name']['image'] = transliteration_clean_filename($_FILES['Filedata']['name']);
}

if ($file = file_save_upload('image', $validators)) {
$image = image_get_info($file->filepath); // Get real mime-type
if (!db_query("UPDATE {files} SET filename = '%s', filemime = '%s' WHERE fid = %d", image_fupload_image_status($field_name, IMAGE_UNMACHINED), $image['mime_type'], $file->fid)) {
drupal_json(array('status' => FALSE, 'data' => t('A database related problem appeared during upload. Please inform the site administrator if this is a permanent problem.')));
exit;
}

// Get all status messages and add them to server message for swfUpload --> inform client
$messages = drupal_get_messages('status');
drupal_json(array('status' => TRUE, 'data' => t('Complete. !messages', array('!messages' => (!empty($messages['status']) ? implode(' ', $messages['status']) : ''))))); // Reply a status message to satisfy swfUpload
}
else {
// Get responsible error messages and send it to swfUpload
$messages = form_get_errors();
drupal_json(array('status' => FALSE, 'data' => t('Upload failed: !errors', array('!errors' => implode(' ', $messages)))));
}

}
else {
drupal_access_denied();
}
variable_set('cache_lifetime', '21000');
}

danyg’s picture

Hello,

I've tried your advice (#9), with a little modification, but it doesn't work.

But if I set cache lifetime earlier it suggested that this value is being set after upload.
So, first I need to get the current value, then we set the cache to empty string (I've tried with 0, without success)

$cache_lifetime = variable_get('cache_lifetime', 0);
variable_set('cache_lifetime', '');

Then at the very end of the code, we set the cache_lifetime to the original value.

variable_set('cache_lifetime', $cache_lifetime);

Unfortunately it doesn't work, and I've noticed another error on the page. If I want to interrupt the permanent refreshing of page (and image_fupload process) and want to save the node I get the "This content has been modified by another user, changes cannot be saved." error.