This topic is locked

Uploading image file works once then fails

6/2/2008 3:55:00 PM
PHPRunner General questions
W
w3bmaster author

I am experiencing a very strange problem with adding a record that contains an image to be uploaded to file.
Here is the scenario where an error occurs:

  1. Login as admin
  2. Add New
  3. Browse for image
  4. Submit -- works the first time.
  5. Add new (still logged in at this point)
  6. Browse for image
  7. Submit -- fails with a PHP Error Happened message (detailed below).
  8. Hit Browser Back button.
  9. Remove filename
  10. Submit (other text fields) -- this works.
  11. Edit (the record where the image failed to upload)
  12. Browse for different image
  13. Submit -- fails with PHP Error Happened message again.
  14. Logout
  15. Login as admin
  16. Edit (the record where the image failed to upload)
  17. Browse for image
  18. Submit - Works! But will fail again until I logout and log back in again, either on add or edit of record.
    This is the PHP error returned:
    PHP error happened
    Technical information

    Error type 2

    Error description imagecreatefromstring() [function.imagecreatefromstring]: Empty string or invalid image

    URL /manager/employee_edit.php?

    Error file E:\Inetpub\www\manager\include\commonfunctions.php

    Error line 1187

    SQL query update `employee` set
    The options I've set in the Visual Editor for the filename field is as follows:
    Required

    Resize if to large

    Create Thumbnail

    Add timestamp
    My Server/PHP config:
    Windows Server 2003 R2

    PHP 5.2.5

    MySQL 5.0.51
    I'm using PHPRunner 4.2 (Build 379).
    Please let me know if there is additional information you need to help me solve this problem, and thank you for any help you can provide.
    Sincerely,

    Rick

W
w3bmaster author 6/2/2008

This issue seems to be resolved.
The script triggering the error, employee_edit.php, uses myfile_get_contents() function before calling CreateThumbnail(). I edited to instead and this seems to have solved the problem. It could be because I'm using Windows Server, but I don't recall having problems with fopen before (fopen is used in the function myfile_get_contents()).
The next question is how do I go about permanently changing myfile_get_contents to [color=#0000FF]file_get_contents without doing it manually after each build?
Sincerely,

Rick

W
w3bmaster author 6/3/2008

Well, I spoke to soon. The error continues, but with unpredictable timing...I can't seem to pin down when the error will be triggered. Sometimes it works great and at other times it just doesn't work...can anyone suggest anything to try to troubleshoot the problem?
Sincerely,

Rick

J
Jane 6/4/2008

Rick,
It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and send to support@xlinesoft.com a URL to your pages along with instructions on reproducing this error.

I'll find what's wrong with your project inspecting it at Demo account site.

W
w3bmaster author 6/5/2008

Will do Jane...I have to clear with the company first since the information is sensitive. I asked today, but I haven't received a reply as of yet.
Thank you for taking the time to help me out.
Sincerely,

Rick

W
w3bmaster author 7/9/2008

I haven't heard any complaints from the clients in a while, so I guess the problem "went away." They do use the app pretty regularly and the error still haunts me...I'm waiting for it to reappear again since I haven't changed anything really...same host, same db, same project.
If I have any more problems though I'll probably switch back to ASPRunner Pro (I have ASPRunenr at work and PHPRunner at home.) Btw: Is it possible to port a PHPRunner Project to ASPRunner Pro?
On another note, does xlinesoft provide hourly services? Such as logging into a client application on the client's host/server? Maybe troubleshoot/debug configuration issues? I'm not stating I need this, but I wasn't sure if it was available if I do indeed need it at some point in time.
Thank you for looking into it Jane.

J
Jane 7/10/2008

Hi,
in general you can port PHPRunner project to ASPRunner. But this task requires some custom coding.
I recommend you to contact support@xlinesoft.com directly with these questions.