How to save files after app migration to server - laravel

I migrated my app to server and after migration, my app doesnt save files in right folder. When I'm trying to upload them.
Its weird because my folders structure didnt change at all, since that was the only reason i supposted that might fail.
My class does save file but instead of public/storage/images it saves it inside storage/app/public/images.
Is this proper folder to save files?
Line of class code that stores files:
$event->photo_patch = $request->photo_patch->store('images', 'public');
Form that makes my images to load:
<label for="Photo">{{ __('Photo') }}</label>
<input type="file" class="form-control-file" name="photo_patch" accept="image/png, image/jpg">
#error('photo_parch')
<div class="invalid-feedback d-block">{{$message}}</div>
#enderror
{{ __('Best if image would be in 16:9 ratio') }}
</div>
Before server migration everything was saving in public/storage/images that's why I'm a bit shocked.
This is my first app that I'm developing and I'm not sure where files should be stored tho.

Related

img src not working to showing Images Laravel 8

i am beginner of Laravel 8. i creating simple project. but when i view the project images are not shown.
View Page
Index.php
<div>
<img src="{{asset('/images/chocolate-ice.jpg')}}" id="Chocolate" class="photo" width="100" height="100" data-toggle="modal" data-target="#exampleModal">
<b>Chocolate</b>
</div>
Folder structure
If you want to use Blade your template/view must end in .blade.php. That is how the view system knows what view engine to use. When it is just .php it does not use the Blade compiler to parse the template.

vue/laravel images not showing (not found) using laravel storage folder

am trying to display my images dynamically from laravel storage folder but it says images not found even though i can see the pictures adding up in the folder, i also tried php artisan link but nothing good
<v-btn flat v-on="on">
<div>
{{connectedUser.name }} {{ connectedUser.last_name }}
<v-avatar size="38px"">
<img :src="'http://api.sirh.test/storage/'+connectedUser.img" />
</v-avatar>
</div>
</v-btn>
Try this.
:src=‘getImage(connectedUser)’
getImage(connectedUser){
return /storage/ + connectedUser.img
}

How to add an image to shopify using liquid?

I am new to this and there are barely any tutorials for liquid, unlike PHP.
Here's what I want to do.
Create a simple box on a page and being able to upload an image into that box, from the theme settings area.
How would I go on about doing that?
See the Shopify wiki page on settings.html:
The settings.html file is rendered on the Theme Settings page of the Shopify Admin.
To upload an image in Theme Settings, you want the File Upload input type:
File upload
Useful for uploading assets to a theme, such as logo images, favicons, and slideshow images...
<tr>
<th>
<label for="my_file">File Upload</label>
</th>
<td>
<input type="file" name="logo.png" data-max-width="500" data-max-height="300" />
</td>
</tr>
Files uploaded through settings.html are placed in the theme's assets folder. The name of the saved file is not determined by the original file, but rather by the name attribute of the file input tag. For example, the file uploaded through the example above would be saved as logo.png. Furthermore, Shopify will convert the image to the type specified in the name attribute.
Then you can access the uploaded file via Liquid as you would normally access assets. For example:
<a id="logo" href="/" role="banner">
{{ 'logo.png' | asset_url | img_tag: shop.name }}
</a>

Why is parsing a tpl file in CodeIgniter giving me an error on a web server?

So, my friend that owns the domain that we are working on set up a live development server for me to upload my files to. I had previously been developing on WAMP. I uploaded the CodeIgniter files to the web server(along with the application) and updated the config files. When everything in the config was working, I refreshed the page and got an error.
Parse error: syntax error, unexpected T_STRING in /blah/blah/html/application/frontend/views/overall_header.tpl on line 1
This is the very first TPL file called in the script. I use the CI template parser library to parse TPL files. It worked absolutely fine on WAMP, but now is giving me this error. The TPL file is just pure HTML.
Any ideas?
PS: The web host is Media Temple.
Base Command
<div id="header">
<div id="toolbar">
<ul>
{TOOLBAR}
</ul>
<div id="search">
<form action="#" method="POST">
<input type="text" name="criteria" value="Enter search criteria, then press enter." class="text-input">
</form>
</div>
</div>
<div id="banner">
<div class="logo">
</div>
</div>
<div id="navigation">
<ul>
{MAIN_NAVIGATION}
</ul>
</div>
</div>
May be this is a problem with difference between new line characters on Windows and Linux systems. On local you use WAMP (Windows), so you use \r\n as new line characters. On hosting (I hope, Linux-like hosting?) it not working correctly, because Linux standard new line char is \n . To solve this you need to change all \r\n to \n before putting files on hosting.
For preventing this in future use editor/IDE which can work with linux-like line chars and may be change WAMP environment settings belongs to new line characters.
This is invisible symbols and you use it in any files what contain line breaks. Check this settings in your editor:

Uploading File in WatiN

How do I upload a file using WatiN?
Is it possible for this file to reside on a web server (as oppose to it being on user's machine)?
Code snippet is highly appreciated. Thanks.
The file needs to be accessible to the client browser. That means it either needs to be on the client machine or accessible through a share. If you want to store files in a central location, either use a shared folder, or come up with a way to copy the file to the client when you need it.
As for uploading the file, that is going to depend on how you have to do it. If it uses a standard file input tag, it would work like this:
HTML snippet:
<form action="upload.asp" method="post">
<input type="file" name="uploaded_file">
<input type="submit" name="submit_upload">
</form>
Code:
void UploadFile(string filepath, Browser browser)
{
FileUpload upload = browser.FileUpload(Find.ByName("uploaded_file"));
upload.Set(filepath);
Button submit = browser.Button(Find.ByName("submit_upload"));
submit.Click();
}

Resources