Image Upload Failed

Hi,
Just wondering if anyone experienced an issue where when upload pictures in a form and after clicking ‘Save’ button, it displays an error ‘Image Upload Failed’. This is not happening all the time but randomly. So that confirm there is no issue with the code and maybe a hosted server issue. Contacted scriptcase support but they needed shell access to investigate but my hosting provider does not allow shell access to the server.

Thought to post here to see if anyone had the same error.

Image field type is ‘Image (File name)’. When uploading images it is shows the progress bar moves to 100% and shows the image after that. But as soon as you click ‘Save’ it returns that error. Most of the time this app works without any issues.

Most annoying part is, it does not let save the record and loose all the data entered. As form has lots of fields to complete, users really getting frustrated when this happens.

Could someone also please tell me, if I can bypass such an error and let user to still save the record? (without the images if error occurred)

Regards,
Aari

image_upload_failed.jpg

Problem:

When we upload an image with file-field, the image was uploaded in tmp-directory, but not transferred in image-directory. Result: The image can’t be displayed.

On the local system (WAMP with PHP 5.3) it works.

Environment of the production-server: PHP 5.4 on 1and1-Hosting-Provider

Work-Arround (solution?):

The problem lies in the lack of time zone definition!

We have changed the third-party-Modul “…\scriptcase7\devel\lib hird\blueimp\index.p hp”

Now, we call the “date_default_timezone_set”-function – after the “error_reporting-call”.

for example:
error_reporting(E_ALL | E_STRICT);
date_default_timezone_set(‘Europe/Berlin’); <-------

This index.php is a template for the scriptcase-generation. And now scriptcase generate the code with this date_default_timezone_set-call.

AFTER GENERATION ALL MODULES -> IT WORKS :slight_smile:

I do not know if this solution applies generally. For us, this work-arround works and we will also sent this work-arround to SCRIPTCASE.

check this out it works for me like charm… or goto this link http://www.scriptcase.net/forum/showthread.php?4172-Image-upload-not-working-in-v7-for-both-file-and-blob-field

after that you must generate the application and uploaded on Production server, will be fine…

let us know about…

Thank you for your reply Ahmer. I will try that out and let you know soon.

Strange thing is, this issue does not happen all the time.

I had this issue since v5, and after almost 2 years its able to fix. but with this fix its working charm…

try it…

ohhh noooo. after two days, it has crashed again. :frowning:

This time the error message slightly different. Error changed from “Image upload failed” to “Upload failed”. Please see attached image. By the way, i have updated the file as per the instructions before generating the code. (\scriptcase7\devel\lib hird\blueimp\index.php)

Also checking the error log, I found three lines with errors. not sure that explains anything??? (see attached)

While checking the forum for related issues i have came across below thread and may be it is referencing to the same problem??? I am using SC 7 and when checked generated php application, i can see top lines have bank values.

thread -> http://www.scriptcase.net/forum/showthread.php?3887-BUG-file-uploading-in-SC6/page1

<?php
//
include_once(‘form_test_application_session.php’);
@session_start() ;
$_SESSION[‘scriptcase’][‘form_test_application’][‘glo_nm_perfil’] = “connection1”;
$_SESSION[‘scriptcase’][‘form_test_application’][‘glo_nm_path_prod’] = “”;
$_SESSION[‘scriptcase’][‘form_test_application’][‘glo_nm_path_imagens’] = “”;
$_SESSION[‘scriptcase’][‘form_test_application’][‘glo_nm_path_imag_temp’] = “”;
$_SESSION[‘scriptcase’][‘form_test_application’][‘glo_nm_path_doc’] = “”;
//

I am attaching an image of field details as well. When uploading images it is creating a subfolder using the primary key. primary key is an auto increment integer.

Under field details i can see a setting called “Image caching”. what this exactly do??? next that there is a scriptcase help description “Time in minutes the image cache will be kept in the server before being deleted.” Should i change this value to something? OR is it ok to leave ‘0’?

cpanel_error_log.jpg

field_details.jpg

upload_failed.png