Jump to content
Sign in to follow this  

Error 404 using upload method of SC's PHP class

Recommended Posts

Gnurps    0

I have a web page that allows users to upload files using normal HTTP upload.  The PHP page to process the upload uses PHP's standard move_uploaded_file() function to get the user's file into a known directory, called "docsTemp" on this system. That works. My script then calls the the upload method of SC's PHP class to move the file into the SC directory. That SC step fails with error 404 (not found).


The goal is to move the file from docsTemp to a nested folder inside the SC folder. The script specifies a section/subsection folder structure. SC, when used through FM web viewer, will create folders as specified by the web viewer URL. So the folder I would expect my PHP script to create would be supercontainer/section/subsection/pkID. But instead, SC is creating folders named "0","1", "2", "3"..."9" that do have the uploaded file. After 10 attempts, the SC upload cycles back to moving the files into folder 0, then 1,2,3 thru 9. 


Why is SC not creating folders like it does through FM web viewer?







Share this post

Link to post
Share on other sites
Gnurps    0

:laugh:The Solution to this problem turned out to be the SC Base URL, again. Our new SC installation confused me. On my  development server, running SC in standalone mode, there is always a SuperContainer folder that holds children folders "Files" and "thumbnails." On new host's server, running SC in Tomcat, we have a "supercontainer" folder which holds the individual files and no "Files" folder. On the new server, the thumbnails folder is a sibling of supercontainer folder.


My host said the SC url is  http://domain:port/supercontainer. It turned out that despite the lack of a Files folder, the url still needs to have that word. So the base url is http://domain:port/supercontainer/Files. 


I previously posted about a similar upload problem and the solution was the same. Kinda confusing... No Files folder but you still have to add "/Files" in SC_BASE_URL.





Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By Richard Carlton
      PHP VIDEO 2 - Process Walkthrough: https://youtu.be/yAQX0B9Hfyk
      PHP VIDEO 3 - Sample Code Review: https://youtu.be/9thUCa_q_eY
      Download Sample Code: http://fmstartingpoint.com/links/dl_proc.php?idc=CPN_S0067
      Live PHP Page to try out: http://fmstartingpoint.com/links/dl_proc.php?idc=CPN_R0068
      FileMaker CWP Guide: https://fmhelp.filemaker.com/docs/16/en/fms16_cwp_guide.pdf
    • By jamescv7
      XML error: No memory at line 1
      Greetings, this error occurred when the Filemaker API cannot generate a bunch of records. (1000+ records and above)
      I've adjusted the time out settings for PHP even the memory limits.
      Is there any possible solution for this?
      According to some information, the error turns out that the 10 MB XML scripts is unchangeable.
    • By Ken d'Oronzio
      FREE fmREST.php – Simplifies & manages PHP connections to FileMaker 16’s REST-based Data API.
      The newly released FileMaker Server 16 now offers REST access to your FileMaker databases. There’s more about that how this impacts PHP developers here.
      The bottom line is that to use REST as part of your PHP solution, you would usually need to write a series of cURL functions and you would have to manually manage connecting & disconnecting from your server, and saving your tokens.
      This is a pain!
      We know it’s a pain, because we have spent the last several weeks rolling REST functionality into soSIMPLE Calendar.
      We created this class file to make it easier to manage dynamic REST sessions for soSIMPLE and our custom development. The goal of the class file was to help PHP developers start using the new REST engine as quickly and easily as possible.
      We’ll also be updating it with new features. If you’d like to add something to it, please let us know.
      What fmREST.php does:
      Makes every REST call available as a PHP function. Automatically login into FileMaker Server whenever you call any REST functions Saves your token for 15 minutes to reuse Checks for a broken or disconnected token and automatically reconnects and runs your function again Where do I get it?
      You can download the fmREST class file here.
    • By GisMo
      I have a php script that takes two PDF files and merges them into one file. I am using this in conjunction with the insert from URL script step. 
      The way the script works is it takes two PDFs in container fields and base64encode each files. Then, those two base 64 strings are POSTed via insert from URL.
      I've tested the script forwards and backwards and it does combine the PDF files reliably. The issue is when posting from FileMaker. What typically happens is the first page is combined twice and that's my resultant PDF. 
      My php script checks that both inputs are different and throws an error is they are identical. I don't get any errors there.
      Is there a way to POST a file from insert from URL?
    • By Jason Mundok
      I have a website that is displaying FileMaker data using the PHP API. Is there a way for the web site to display the basic text formatting from a FileMaker field? For example, a few words in the comments field are bold in FileMaker and I would like them to also be bold on the website. Thanks for any ideas.

Important Information

By using this site, you agree to our Terms of Use.