This topic is locked
[SOLVED]

 Unclear on how to upload images

5/2/2015 8:19:42 PM
PHPRunner General questions
B
bioman author

Hi,

I would like my users to be able to upload images using PHPRunner. I have read the documentation on this but I'm getting errors. What I'd like to do is store the images in a folder called "images" that I put on my server. I'd like to store URLs to each image in the database. The way I have it set up now, I put a regular folder on my website called "images." The url for the folder is http://quizninja.net/images/
I tried using this as the path, but I received an error. Here is the error: "SyntaxError: Unexpected token" What should the path be? By the way, I am running the PHPRunner application from my computer and haven't published the application to the server yet. Is this the problem?
Is there an example of what the path should look like? Any insight would be much appreciated. Thanks,

Brett

(Note: I am using PHPRunner version 8)

Admin 5/4/2015

Upload path needs to be specified as "images". In this case PHPRunner will store image paths as images/file1_dlskflejs.png and this is how it normally works.
Make sure that web server user has write permissions on this folder. Also make sure that database field is large enough to store the upload file info, it requires up to 400 characters per file.

B
bioman author 5/4/2015

Hi Sergey,

Here is what I did:

  1. In the box in PHPRunner that asks for the upload folder, I typed in the word "images" (I did not include the quotes).
  2. I set my write permissions for the images folder to "world" in my file manager.
  3. I changed my database field to "mediumtext."
    But I am still missing something because what I've done is not working. Here are some of the issues:
  4. I am receiving the following error when I click on the name of the image file in list view: "Fatal error: Class 'RunnerPage' not found in C:\Users\brett\Documents\PHPRunnerProjects\Project3\output\include\commonfunctions.php on line 692"
  5. There is no image file being added to my "images" folder even after I add a record with an image.
  6. Instead of a thumbnail being generated, there is a generic picture icon, but when I click on this, no thumbnail is displayed (but it does gray out the background).
  7. The image name is uploaded to the database field but it does not have a full url to its location. It just says, for example "image.jpg"
    I am not sure what I'm doing wrong. I'd appreciate your insight.
    To be clear, I am hoping to store a web-accessible URL to the image file, since it will be accessed by an external application by calling the URL.

    Thanks,

    Brett


    Upload path needs to be specified as "images". In this case PHPRunner will store image paths as images/file1_dlskflejs.png and this is how it normally works.
    Make sure that web server user has write permissions on this folder. Also make sure that database field is large enough to store the upload file info, it requires up to 400 characters per file.

Admin 5/4/2015

As I mentioned earlier - it would not store the URL of the image. According to your settings (Basic upload vs Advanced upload control) it stores either just a file name or a relative path to image along with other file info.
You can write the code to store the full image URL instead of what it stores now but you will lose the capability to edit/delete/replace uploaded files and also you won't be able to move your application to another location as URLs will become obsolete.

B
bioman author 5/5/2015

Hi Sergey,

I see one of my problems was that I didn't realize that PHPRunner was creating the folder to store the images. I see now when I look at the output folder that the images are there, but I still do not see thumbnails on my list page, and when I click on the file name I get the following error still:

"Fatal error: Class 'RunnerPage' not found in C:\Users\brett\Documents\PHPRunnerProjects\Project3\output\include\commonfunctions.php on line 692"

What does this mean and why is the Class 'RunnerPage' not found?
Regarding using a full URL, I believe this will be necessary to make my application work, but perhaps I could store the full URL in a different field. Would this work? Thanks,

Brett

Admin 5/5/2015

Sure, it may work.
If you need more help with that error you getting publish your application to Demo Account and send a ticket to support with the URL where we can see and troubleshoot this issue. 'Demo Account' button can be found on the last screen ('Finished') in the program.

B
bioman author 5/5/2015

Hi Sergey,

I uploaded the project to the demo account and sent in a support ticket as you mentioned. The name of the support ticket is: "Fatal error with image upload."

The URL to the project can be seen in this ticket. Thanks,

Brett



Sure, it may work.
If you need more help with that error you getting publish your application to Demo Account and send a ticket to support with the URL where we can see and troubleshoot this issue. 'Demo Account' button can be found on the last screen ('Finished') in the program.

Admin 5/6/2015

Answered your ticket. The very first step is to get the latest build of PHPRunner 8.0.

B
bioman author 5/8/2015

Thanks! Updating to the latest build fixed the problem.



Answered your ticket. The very first step is to get the latest build of PHPRunner 8.0.