Expression Engine - How do I upload an image using SafeCracker? - expressionengine

I am new to SafeCracker and while I have been able to enter most other input types, the File input type is not working correctly for me.
Here is the code I am using on field type File named event_icon
<label for="event_icon"><span>*Event Icon:</span>
<input type="file" name="event_icon" value="{event_icon}">
</label>
I also tried:
<label for="event_icon"><span>*Event Icon:</span>
{field:event_icon}
</label>
No joy.
Any suggestions?

Hmm, not sure what's happening exactly, but you have a javascript error on your page that's coming from the EE javascript output relating to the File field.
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
/?&ACT=10&action=setup&_=1334166664318
I'd try changing the File field to Safecracker File, it's a much simpler fieldtype.

Related

Nest.js - process.env.npm_package_description does not return correct value

When running Nest.js application process.env.npm_package_description returns
[Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
instead of description that is in package.json
So, I don't know the why yet, will update when I can find the code, but it looks like what is happening is that when the description in your package.json is empty then process.env.npm_package_description gets set to the first line (or close to it) of your README.
pnpm seems to not do this.
npm brings back a value like <p align="center"> <img src="https://nestjs.com/img/logo-small.svg" width="200" alt="Nest Logo" /> </p>
yarn brings back a value of [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository. (this is the first line under the ## Description tag in the README, might be related)

Static source file(.html) update does not working to application

I am just a newbee to jhipster. finally I generated jhipster and runned an application. I tried to change static file(.html) for test.
What I did as follows.
I changed src/main/webapp/app/layouts/footer/footer.component.html file content.
('This is your footer' --> 'This is your footer !!!!!')
Executed command yarn start. Application running without problem.
I found running application footer still' This is your footer'. But footer.component.html file content still 'This is your footer !!!!!'.
I tried many times but application's footer still unchanged.
I tried compile executing command yo jhipster.
Terminal Ask overwriting footer.component.html file? so I typed 'y'
After compile I checked footer.component.html file content. but it rolled back to the original file ('This is your footer'. not 'This is your footer !!!!!')
Please Teach me what I had missed. How can I change contents of static files.
This problem makes me crazy for last 2days.
Thanks in advance.
Please let us know if you installed any language while creating the project.
If yes then jhipster uses this following library for translations, so the actual String comes from a json file.
https://angular-translate.github.io/
You can do the following.
Instead of
<div class="footer" ng-cloak>
<p data-translate="footer">This is your footer</p>
</div>
Try the following.
<div class="footer" ng-cloak>
<p>This is your footer!!!</p>
</div>
Or a better option would be to change the json file.
src/main/webapp/i18n/en/global.json
"footer": "This is your footer"
to
"footer": "This is your footer!!!"

Coldfusion Nondescript Error Message

I have a coldfusion application that queries an oracle database for some data, converts the query into a CSV variable via a function creaeted by Ben Nadel, and is supposed to use a tag to then convert the csv value into an excel spreadsheet. However it is giving me the following error:
"The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
3
The error occurred in C:/inetpub/wwwroot/APPS/CapDB/generate_extract.cfm: line 312"
Here is the section of code it is referencing:
<cfspreadsheet action="Write" filename="C:\inetpub\apps\capdb\files\extract.xls" format="csv" name="strOutput" overwrite="true">
I've tried sending it different csv variables, even one created by Ben Nadel to work specifically with his custom function and the cfspreadsheet tag. The only thing that changes with the error when I use different csv variables is what number is displayed. I've seen 3 and 35 so far. Has anyone ever encountered an error like this before?

Uploading file, getting fakepath

I am trying to upload a video to youtube through their API
I use a HTML input field, but for some reason, it gives me a path like
C:\fakepath\..
Why is this and how can I get the right filepath, so I can use it in my request
<input type="file" name="fileName" data-schema-key="fileName">
This question has already been answered here: How to resolve the C:\fakepath?.
As commented in The Mystery of c:fakepath Unveiled:
According to the specifications of HTML5, a file upload control should not reveal the real local path to the file you have selected, if you manipulate its value string with JavaScript. Instead, the string that is returned by the script, which handles the file information is C:\fakepath.
If you want to leave just the filename (for "beauty" purposes), you can do a simple string replacing operation.
// Change the node's value by removing the fake path
inputNode.value = fileInput.value.replace("C:\\fakepath\\", "");
You can't, however, have access to the original file path. "It makes sense - as a client, you don't want the server to know your local machine's filesystem. It would be nice if all browsers did this", as already pointed out in the SO question I cited in the first line of this answer.

Fix inaccurate reported error with ReSharper 9.0

I have recently installed ReSharper 9.0 for use with VS 2010 from version 7 and am now seeing reported problems and error with RS that are not correct. These are all in the .cshtml files. First, for something like
$(".previous").prop("disabled", true);
The named class previous is kind of greyed out and the warning is that the class is never used, but it is. How do I fix this and get RS to not report this wrong warning?
The next problem is more severe. I have a line in the HTML like
<input class="last" type="button" id="btnLast" onclick="last()" value=">>" />
from this line down in the file are nothing but red lines on the side panel and wrong errors like tag table not closed, tag div not closed, and so on. If I remove the ">>" then everything is fine in the file. Is there a new setting that I cannot find for RS 9?
First analysis often gives false positive results, so it will be removed in upcoming 9.1 version.
Second issue is already logged in our tracker https://youtrack.jetbrains.com/issue/RSRP-429055. Over there workaround is provided. In short - use html entities.
<input class="last" type="button" id="btnLast" onclick="last()" value=">>" />

Resources