Storage::move giving “File not found at path:” - laravel

I am trying to move an image from one folder into another folder by using:
Storage::move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
But when i run it gave me the error:
File not found at path: home/vagrant/code/avida/storage/app/public/temporary/5bfb7272e9dc9.download.jpeg
i google and found the following solution:
Storage::disk('local')->move(storage_path('app/public/temporary/').$imageName, storage_path('app/public/profilePic/'.$imageName));
but then it gave another error:
Method 'disk' not found in \Illuminate\Support\Facades\Storage
Can anyone please help me how can i move this file ?
Thank you

Storage class operate in storage directory so there is no need to use storage_path() helper.
Change your code to the one below:
Storage::move('public/temporary/'.$imageName, 'public/profilePic/'.$imageName);
I hope that helps :)

Related

ModuleNotFoundError: No module named 'ingredients'

Following the Graphene-Django basic tutorial verbatim results in this helpful situation.
Maybe there is a dir problem or something? As soon as we add the installed app, it is not found?
Tried everything here
Try to open "cookbook/ingredients/" folder and change name in IngredientsConfig to cookbook.ingredients:
class IngredientsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'cookbook.ingredients'

Why am I getting error code 135 when applying patch through opatch?

I am trying to write a script that automates opatch, but before I get into the actual scripting I want to test the commands directly through the command prompt. My oracle home is C:\oracle\Middleware, and my patch 23094292 folder is located in the Middleware folder. Here are the commands I am using to apply the patch:
cd C:\oracle\Middleware\23094292
C:\oracle\Middleware\OPatch\opatch apply
When I run the latter command I get this:
ZOP-51: The patch location is not valid for apply, because it doesn't have correct metadata, or it points to a patch directory.
Argument(s) Error... Patch location is not valid for apply
Please check the arguments and try again.
OPatch failed with error code = 135
Shouldn't oracle home be the valid patch location? I am not too familiar with Oracle's product's, so I'm not certain. Please let me know if I can provide any further information. Any help explaining what I am doing wrong would be greatly appreciated.
You're missing a directory in the 23094292 directory. There should be two directories in there, "files" and "etc". And then there should be a "README.txt" file there as well.
Edit: I'd just suggest removing the 23094292 directory and unzipping the zip file again, or re-download it if that doesn't work.

YarnRuntimeException file doesnt exist

I'm trying to run a Pig script, getting the error org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.yarn.exception.YarnRuntimeException): java.io.FileNotFoundException: File /tmp/hadoop-yarn.staging/history/done/2015/01/08/000000 does not exits !!!
what does that mean ? shoudl I create it ? where should I put it ?
I ran into the same problem today and found out YarnRuntimeException is included in the hadoop-yarn-api-2.6.0.jar file. Make sure it's in your class path and you should be good.

Tell selenium to look in my C:/Downloads folder (Ruby)

me again!!
I have a question based around the download of a file. I was helped with setting up a Firefox profile to set a download to save a file directly without a pop up window. Now I need to tell Selenium to confirm that the said downloaded file is in my downloads folder on C drive to complete the test. Is there a way to do this? I've trawled for answers and have gotten nothing.
I first tried by setting a path like so on my env.rb file but didn't get very far with it:
$download_location = 'C:/Users/User/Downloads'
def download_location(path)
$download_location + path
end
Then telling cucumber to visit this location and confirm the name of the file.
Any help on pointing selenium to the location and confirming the name of a csv file would be hugely appreciated
Thanks
If you want to use ruby instead of selenium, you can use the exists? method to check the downloads directory for a given file, and it will return a Boolean result. For example:
File.exists?('C:\Users\User\Downloads\foo.txt')
I have found a solution that worked for me:
puts Dir["C:/Users/OSAT TESTING/Downloads/**/fleet_#{export}_export_all_*.csv"]
This confirmed the download of the file by looking in my downloads folder and returning the file path + name of any file that contained "fleet_#{export}_export_all_*.csv" in cmd prompt.
Thank you all for your help
:-)

Web Deploy Package Error 'File ... does not exist'

I've trying to package up and old MVC 3 project to send it out but I keep getting a strange error where it telling me
'The file '/Views/Shared/print.Master' does not exist. /Views/Questionnaire/View.aspx'
But I can clearly see the file and have renamed it to try and fix it but no luck, then I tried changing the package settings to include everything but that too didn't fix it so does anybody have any idea why this could be happening? (btw it's a 2nd master file)
Any ideas or help would be much appreciated.
Solution was to check file Properties and set 'Build Action' to 'Content'.

Resources