snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11k stars 3.17k forks source link

Uploaded image path wrong #429

Closed gt7810 closed 9 years ago

gt7810 commented 9 years ago

When I upload an image file to an asset the path is set to: /uploads/models/pYNmoN2mvZUv8GnBK0AuVjmPy.jpg the real path is: /snipe-it/uploads/models/pYNmoN2mvZUv8GnBK0AuVjmPy.jpg I have installed the application in a directory that in a layer down from webroot.
This means the image path is broken. Any ideas on how to fix this?

Thanks George

snipe commented 9 years ago

What is your actual webroot?

snipe commented 9 years ago

Something looks donked there. The path to your webroot in your server should be to the public directory within the Snipe-IT app. So the image path should look something like <your server path>/snipe-it/public/uploads/models/blah.jpg.

gt7810 commented 9 years ago

webroot is /apps/ snipe-it is in a folder under /apps/ I fixed by editing the path in backend/models/view.blade and edit.blade. Is there somewhere I can set this globally?

snipe commented 9 years ago

Snipe-IT is meant to run from with the app/public directory as the webroot. Not sure what you'll have to do to get it running as a sub-directory.

snipe commented 9 years ago

This may be helpful to you tho: http://stackoverflow.com/questions/16683046/how-to-install-laravel-4-to-a-web-host-subfolder-without-publicly-exposing-app

gt7810 commented 9 years ago

Thank you! Will have a go. Cheers. G

snipe commented 9 years ago

Hi @gt7810 - did you get this sorted? (I'd like to close this issue if you have)

gt7810 commented 9 years ago

Yes. I updated the path in the blades. Temp fix but works for now. Thanks On 23 Jan 2015 06:19, "snipe" notifications@github.com wrote:

Hi @gt7810 https://github.com/gt7810 - did you get this sorted? (I'd like to close this issue if you have)

— Reply to this email directly or view it on GitHub https://github.com/snipe/snipe-it/issues/429#issuecomment-71110975.

snipe commented 9 years ago

Hm, that's going to screw you up when you upgrade tho. What OS is your server? If your webroot is still apps, that's going to be a problem. Should be public within the snipe-it app directory.

gt7810 commented 9 years ago

Server is OS X 10.6. It is also running railo so config is a little delicate. I am thinking of moving snipe to a new server which will solve the webroot issue. On 23 Jan 2015 06:28, "snipe" notifications@github.com wrote:

Hm, that's going to screw you up when you upgrade tho. What OS is your server? If your webroot is still apps, that's going to be a problem. Should be public within the snipe-it app directory.

— Reply to this email directly or view it on GitHub https://github.com/snipe/snipe-it/issues/429#issuecomment-71112331.

snipe commented 9 years ago

Ahh, yeah, that's a bit sticky. I guess the temp fix will work until you move it, but remember to change that path when you upgrade on the OS X server or you'll run into the same problem again.