404 Not Found when Uploading assets using Base_posts_model module

Hi, I have two different modules both extended from Base_posts_model. When I upload the asset from one of them it uploads fine, but when I do the same for the other it returns a 404 not found CI page, in the dialog box, no matter what method I chose it's same i.e. Upload Asset or Select Image and then Upload Asset.

Comments

  • Check your browser console to see what URL is being tried. Is it valid?

  • edited June 2018

    Tried your suggestion, this is the url being made, but I don't know if that is allowed.
    http://SERVER_URL/fuel/assets/inline_create/615731685a32567a4c32356c64334d3d?asset_folder=images%2Fnews&subfolder=&userfile_file_name=&overwrite=1&unzip=1&create_thumb=0&maintain_ratio=0&width=200&height=200&master_dim=&resize_and_crop=&resize_method=resize_and_crop&hide_options=1&accept=&multiple=0&remove_subfolder=0
    SERVER_URL = project directory which is correct
    and I am getting a 404 response with this, but with other module, same call is sending 200

  • That appears to be a valid FUEL URL so I would next check on a different server environment / browser to see if there are any differences there that may be causing an issue.

  • Tried your suggestion in Opera, previously using Safari on local, on a live environment I have tested on Safari, IE11 and Edge.

  • What version of FUEL are you running? Also, for the FUEL "Assets" controller, is fuel/modules/fuel/controllers/Assets.php file named capitalized?

  • I had been using 1.4.3 but recently I made a clone form develop branch.
    Yes, it is.

  • Does anybody have answer as to why I can't upload images for some module but can for some?

  • What is the URL for the one that is working and the URL for the one that is not?

  • Thanks for replying, I have already posted the action url being made in the comments of a non-working example. And here's the one which is working
    http://SERVER_NAME/fuel/assets/inline_create/615731685a32567a?asset_folder=images%2F&subfolder=&userfile_file_name=&overwrite=1&unzip=1&create_thumb=0&maintain_ratio=0&width=200&height=200&master_dim=&resize_and_crop=&resize_method=resize_and_crop&hide_options=1&accept=&multiple=0&remove_subfolder=0
    but it does not seem any different or am I missing something?

  • Make sure you have a folder at assets/images/news and that the folder is writable.

  • hmm... but I don't have such folder for my working module?

  • The asset_folder query string parameter in the one that isn't working is looking for a folder of assets/images/news which I'm guessing doesn't exist or isn't writable and is causing that 404 (you can look in the fuel/modules/fuel/controllers/Assets.php).

  • edited June 2018

    Okay I don't understand how but you got it working by simply creating a folder in images named news, so how did that worked and I have a very similar module or an exact copy of it but when I am doing the same thing for that module named project, its not working, I tried projects and project as folder names, but I looked at the url generating and it was telling me to create a folder with 'P' in projects, so how can I say that upload to images and not any subfolders?

  • The Base_posts_model::form_fields model will automatically create that folder path for you if you look at that code (which you can overwrite).

  • Thanks i'll try that

Sign In or Register to comment.