My $_Files isn't working and i did everything i read from all people remarks. Maybe someone can help me
<div class="form-check">
Select File :
<input type="file" name="file" id="file">
save
I put this line(and many more)
$file = $_FILES['file'];
and I'm getting an error :"Notice: Undefined index: file"
Someone suggested to put this 2 lines before. it help only for "file" but it didn't know all the other properties like: size, tmp ....
$_FILES['file'] = array();
$_FILES['file']['name'] = $_POST['file'];
and i checked that in my php.ini the upload in on.
I would really love to get help
Related
In my Umbraco 7.15.7 I'm displaying images in the Partial Views Macro Files as follow:
figure>
#if (newsItem.HasValue("articleImg"))
{
<img src="#Umbraco.Media(newsItem.articleImg.ToString()).Url" class="img-fluid news-img" alt="#newsItem.Last().photoAlt" />
}
(the reason for the .ToString() is after I switched from Obsolete to Media.Picker2 - so since it's string)
In my Umbraco 11.1 I was struggle to display the images. I tried the following and it didn't display the images, but also didn't throw an error, just didn't display the images:
<img src="#Umbraco.Media(newsItem.Value<IPublishedContent>("articleImg").ToString()).Url()" class="img-fluid" alt="#Imaging_pagesToList.Last().Value("photoAlt")" />
So I tried this one:
<img src="newsItem.Value<IPublishedContent>("articleImg").Url()" class="img-fluid" alt="#newsItem.Value("photoAlt")" />
And this one also doesn't show any image
I also tried this one (the same as above, just with # - #newsItem) , and this throw an error: "Argument 3: cannot convert from 'method group' to 'object?'":
<img src="#newsItem.Value<IPublishedContent>("articleImg").Url()" class="img-fluid" alt="#newsItem.Value("photoAlt")" />
So I tried this one:
var image = newsItem.Value<IPublishedContent>("articleImg");
<img src="#image.Url()" class="img-fluid" alt="#newsItem.Value("photoAlt")" />
And this is finally works! And I don't understand why? (why this works, and why the previous didn't work)
My question are:
Why only the last one works?
Why the first two doesn't work?
Is this is the right way to render images in Umbraco 11.1 ?
In the official documentations of Umbraco (9 and up) they suggest to render images as follow:
var mediaItem = Umbraco.Media(Guid.Parse("55240594-b265-4fc2-b1c1-feffc5cf9571"));
But they hard coding the Guid in their examples.
Not sure how to get the Guid for each node.
Please advise.
Thanks.
Please check what property editor is used; maybe it's a collection and not a single media. In that case, you will need something like:
newsItem.Value<IEnumarable<IPublishedContent>>("articleImg").First().Url()
I am using Jenkins Active Choice plugin. I want to provide a file upload function based on reference variable
The below setting allows me to enter text when i select reference parameter scan_type as vulnerability-Web
What i want is , instead of taking text input it should upload file , and content of the file should be assigned to SELENIUM_RECORDED_FILE
I tried using below groovy
if (scan_type.equals("Vulnerability-Web")) {
inputBox = "<body> <form action='upload.php' method='post' enctype='multipart/form-data'> Select file to upload: <input type='file' name='fileToUpload' id='fileToUpload'> </form>"
return inputBox
}
its adding file upload option but the file content is not stored in SELENIUM_RECORDED_FILE
Please let me know how can we achieve this
Reading through HERE, it looks like you must have
<input type="file" name="file">
I have created my own enduser_setup.html file nodemcu(for the enduser setup module: https://nodemcu.readthedocs.io/en/master/en/modules/enduser-setup/#enduser_setupstart).
I have added another field (beyond the ssid\password fileds):
<input id=result1 type=text autocorrect=off autocapitalize=none placeholder='Place ID' />
I want on submit to create a lua file (result1.lua) with the Get result of this field.
Tried with php:
<?php
$myfile = fopen("result1.lua", "w") or die("Unable to open file!");
$txt = $_GET["result1"];
fwrite($myfile, $txt);
fclose($myfile);
?>
Did not work :(
That is currently not possible with NodeMCU. However, there is a pending pull request that'll add this feature. It's likely going to be merged to the dev branch in the next days.
I am trying to add a download link to a file on my page, the file can either be a Microsoft Word document, a PDF file, or zip file or some other kind of document, i have the path to the file stored in my database, my issue is it works on my localhost but on the server I get: NotFoundHttpException
This is how the link is generated:
<span class="fa fa-download"></span>
This is how the file url looks like:
'uploads/data/library/G7TkXMdk7BAB12Cn//Guide.pdf'
In your problem, try to use helper function that is called link_to_asset.
{{ link_to_asset($row->file_url, "Download", array("class" => "widget-control-right")) }}
But the better approach is here :
<span class="fa fa-download"></span>
In your route.php
Route::get("file/download/{id}", array("as" => "file.download", function ($id) {
$row = Model::find($id);
return Response::download($row->file_url);
}));
Hope it will be useful for you.
When trying to include a php file into another it either does nothing at all (no errors). If i require it will give a useless message
"Failed opening required 'http://example.org.com/xxx.php' (include_path='.:/usr/local/php5/lib/php')
<div id="menu"> <?php include("http://www.sitename.com/menu.php") ?> </div>
The file im trying to include is on the same site and host.
The page im including from is:
root/wiki/skin/index.php (mediawiki)
menu.php is located:
root/menu.php
since mediawiki treats the /wiki/ path as the root i cannot back out with ../../ etc.
What am i doing wrong here? Thanks
Sir, try this:
<div id="menu"> <?php include("../../menu.php") ?> </div>
To include URLs in your PHP project you must have enabled (true) this option:
allow_url_include
in your php.ini configuration. More information you can find here:
http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-include