Uploaded folder of images to Pinata (IPFS) but the URL structure is coming back strange - ipfs

Im trying to create some NFTs. I've done this before and im familiar with the process but never encountered this issue before. I uploaded a folder of images, so I can include the CID in my metadata (.JSON files). For some reason when I click on files in the folder I uploaded on Pinata its adding characters to the URL that should not be there
Expected Result: https://gateway.pinata.cloud/ipfs/[CID]/1.png
What im getting: https://gateway.pinata.cloud/ipfs/[CID]/%201.png
Pinata/IPFS keeps appending "%20" to the beginning of my file names in the folder rather than just leaving it as "1.png"
Does anyone know what might be going on? I've tried deleting and re-uploading my files several times

This means your files have a leading space. This can happen if you programmatically created it (easy to accidentally add a space in your file name).
%20 is the url encoding for a space: https://www.w3schools.com/tags/ref_urlencode.ASP

Related

HTML files have disappeared from VS Code Project Folders

Upon opening my VS Code project and selecting the single HTML file inside it, a prompt appeared stating that the HTML file doesn’t exist: “(Error: Unable to resolve nonexistent file [file path])”. I opened the only other VS Code project I have containing an HTML file and the single HTML file within that project had disappeared as well.
I then opened Finder and, navigating to the two projects, found that there were no longer HTML files inside either project folders; only the CSS and JavaScript files I had created were there. Having not opened or touched the projects for about a week or so, I’m confused as to how these two HTML files in two different projects are both now “nonexistent.”
So far I’ve tried to show hidden files in Finder, look up the file names in Spotlight Search, check my Trash bin, and search for the file in my iCloud Drive. However, I still haven’t been able to find or recover the files.
Try to change the file extension from .html to .blade.php . Close your vs code and try to open your projects again.
from the get started window open the folder or file there the drop down menu didn't work for me

MediaWiki filepath Magic Word doesn't work for some files types

I'm trying to use the MediaWiki filepath magic word` so that I can create some template links that pass a specific MediaWiki file. Unfortunately with certain file types, filepath just returns nothing.
The file I'm trying to get the path for that's failing is a text file in this case. I have confirmed that I am using the correct filename as I can create a regular file link using [[File:Name.txt]], and {{filepath:Image.png}} works properly.
Example of what I'm trying to accomplish:
[http://server/processfile.php?path={{filepath:<filename>}} Process A File]
Is this a known issue? Is there an easy way that I can debug what's happening here?
After digging around a bunch more I was able to resolve the issue. It turns out that even though the MediaWiki would accept the file, it was being assigned a random mime type because it was a .yaml file.
After updating mime.types and mime.info in MediaWiki and adding the mime type (text/yaml) to my IIS configuration, I was able to get the downloads working and the file links showing up.
Full disclosure: I may have been using an incorrectly cased file name even though I said that I was using the correct file name. :P

Inject/Remove HTML via Chrome Extension

I'm making a chrome extension and on a specific web page I have a table that has commented out information.
I'd like to remove the comment syntax so that the information is displayed in the table
What kind of content script would I need to parse the HTML for the specific comment syntax and then remove it?
Also, every time I pack my extension to a .crx file the file size nearly doubles. Is this standard? My 16 kb files are turning into a 40 MB extension- I'm worried that it isn't supposed to work like that.
First off, likely when you package your extension into a .crx file, you're putting the resulting .crx file in the same folder as your source files.
Then the next time that you package the extension, instead of your source folder having just the files you want to package, it has the files you want to package plus the previous .crx file. Every time this happens you effectively (just over) double the file size. To prevent this, make sure the .crx file is getting saved to the parent directory.
As far as the uncommenting HTML goes, I would check out this answer:
Uncomment html code using javascript

Linking Uploaded File in Phpmailer

I'm trying to store links to files uploaded with phpmailer in my MySQL database so that when a web page calls the record, the user can download the files.
My files were getting attached as I want before I added the anchor tag. Now they no longer get attached to the email, and only the file names are making it into the database. Am I missing something simple?
$mail->AddAttachment("<a href='/home/company/upload/'>".$_FILES['rfile']['name'][0]."</a>"); // add attachments
$mail->AddAttachment("<a href='/home/company/upload/'>".$_FILES['rfile']['name'][1]."</a>"); // add attachments
Why are you putting HTML into something that's expecting a path to a file? Do this instead (and pay attention to what Marc B said - you should be calling move_uploaded_file() somewhere.).
$mail->AddAttachment('/home/company/upload/'.$_FILES['rfile']['name'][0]);
$mail->AddAttachment('/home/company/upload/'.$_FILES['rfile']['name'][1]);

save html page from the server by URL with no changes - get the exact copy, the clone

Let's say I have a URL http://example.com/path/to/document.html
That's the html document, the file, that has no external css or js.
If I open it in Google Chrome and save it with Ctrl+S locally, the content is changed. The content of that html file starts with <!-- saved from url= which is not I want at all. I need to get the exact html document, even spaces count.
The second option is to copy it with Ctrl+U (View Source), Select All and paste it into new document, save it and rename it. This is better, however spaces, tabs and end of file will be different depending on what operation system I'm using.
I need the exact copy of that html file - byte to byte.
How to make it?
This is a practical question as I need slightly modify that document.
I'm sorry there is no any source code in my question, but this question is about web developing.
Any ideas?
Thank you.
P.S. Of course that document could be generated by php or whatever, the part of the code can be even extracted from the db, but not in my case. I know that's a plain file.
I'd delete the comment after saving from Chrome, use wget in a linux environment, or open the page as an InputStream in Java. Do all three, run a diff, and if two arrived identical assume that's the file on the server.
Why do you need a byte-for-byte copy of the file on the server anyway, and why can't you ftp the file? There is always the chance that the server will serve different html files depending on your user-agent, but there are other tools which may be better than Chrome for getting your copy and many can spoof a user-agent as well.