#Having Issues Uploading Images After Deploying Laravel App

76 messages · Page 1 of 1 (latest)

strong grail
#

I recently deployed my Laravel application, and everything seems to be working fine except for one major issue: I'm unable to upload images. This feature worked perfectly in my local environment, but after deployment, the image uploads fail without clear error messages.

I've double-checked file permissions and the storage symlink (using php artisan storage:link), but the problem persists. I'm not sure if it's a configuration issue on the server or something else I might be missing.

spring osprey
#

Hi. How are you storing your images?
Do you mind sending the code you use to handle that?

#

I had a similar issue. And I think I had to change the driver.

strong grail
#

no broo

#

yeah

#

locally works bro

#

the problem is that u have to change http to https

#

look ur console and network

chrome gorge
#

How do I revert a maintenace page on Laravel?

#

Please help

spring osprey
spring osprey
strong grail
#

how do u change the folder?

#

if i fix this the next step is changing the folder

spring osprey
#

Okay le tme know how it goes

strong grail
spring osprey
#

But basicaly, I chanded my FILESYSTEM_DISK from local to public

in .env
FILESYSTEM_DISK=public

strong grail
#

ooo

#

here ?

spring osprey
#

In your .env

spring osprey
#

And I do this

    // Determine the storage disk based on environment
    $disk = config('filesystems.default');

    // Store the file
    $path = $file->storeAs($directory, $filename, $disk);


    // Generate the full URL
    return Storage::url($path);
strong grail
#

where?

spring osprey
#

In your code for uploading images

strong grail
#

oooo

spring osprey
#

Paste your current implementation of uploading images

strong grail
#

i use filament

#

hold on

#

FileUpload::make('imagen')

spring osprey
#

Oh I see

strong grail
#

i will send u my real issue

spring osprey
#

Ok.. What's the real issue?

strong grail
#

I'm working on a Laravel project hosted on Railway. I've already configured AppServiceProvider to force HTTPS in production using URL::forceScheme('https'), and I’ve also set the base URL (app.url, asset_url, etc.) to use https.

The site correctly loads all pages and assets over HTTPS. However, when uploading an image, Laravel still generates a public URL that starts with http:// instead of https://.

The image itself uploads correctly and is displayed without issue, but the generated URL uses HTTP, which leads to mixed content warnings in the browser.

#

u see

spring osprey
#

I see.

strong grail
#

knows the problem?

spring osprey
#

Send a screenshot of your APP_URL in .env

strong grail
spring osprey
#

Try this

ASSET_URL="${APP_URL}"

strong grail
#

in my .env?

spring osprey
#

Yes

strong grail
#

ok

#

xd

#

my filament.

#

bro

#

i fixed

#

ur error was this

#

@spring osprey

spring osprey
#

What was the error?

strong grail
#

no no

#

i fixed the http error

#

know i having another problems

jolly cliff
strong grail
jolly cliff
#

If you're using form requests, please remember to setuo the authorize() method

jolly cliff
strong grail
#

I FIXED

#

check that

#

My new mistake is, where to know where to host the images so you can show them to me

strong grail
#

how i change te upload file

jolly cliff
strong grail
#

bro??