-
Posts
182 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Schaken's Achievements
-
Yes. Which is what I am looking for. I sent the files using Base64Encoded. I sent it in Binary form, i sent it as Bytes, I sent it as JSON. I can not find anything that says "To upload files, please use XXXX". So I'm pretty bent on the fact the API is broke when uploading, since I tried to upload in every way possible. Even if there was an example wrote in PHP, I could easily figure out what is needed to upload something, but the only thing I can get to upload is just strings, which is the forum.
-
This is what is returned to me AFTER I upload, I need to know what TO upload. I Have the file on my computer. Now how do I get it from point A to point B. I can upload it, and my app will even show me the entire file is uploaded, I am using the correct key. I can upload it as bytes[] I can upload it as Base64Encoded, I can do it any way you tell me to, but nowhere does it say how to upload it. I am out of ideas on how to upload any file, because no matter what I do, I cant upload anything other than strings, which is for the Forums app.
-
I seem to be missing it. can you screenshot or copy and paste where it says what format to upload the files in. I looked 3 times today thinking I was blind, but I still do not see.
-
Here is alot of my issues: I always go off the Documentation. But sending an "Object" is just not clear. For example, when posting an image (ALSO cant get to work) it says to upload as 64 bit encoded. So, it is at least giving me a hint of what form to send the file in. but here we have "Object". So, I tried sending it as "Bytes" as that would make the most sense, but this don't work. So, I reverted to the idea of "64bitEncoded" and that also failed. So, I tried many different forms and mixtures of each. I used ChatGTP to help me which sent me about 6 different ways, all failed. I googled ways, no one even uses Invision Community according to google, because there is no information outside of here. At this point if I cannot solve this API issue, I'm going to start the process of using a different framework. I have another website as well where I went with Xenforo, and I can upload to its API with no issues. Considering that I can upload files and images to pretty much any API that I can find except here, I am in the thought that the API is broke, its locked only accept internal calls, or there is just something really weird about the form to send it in that only Invision is using and isn't documented.
-
I also used ChatGPT, it fed me about 4 different ideas, none of which worked either, I fed it my code and it made a few different ideas and none of those worked. I debugged a bunch and my file path to my file is correct, the file while debugging showed my file is 2MB in size, and all my parameters are correct. I just don't understand because I can upload files to GoFile, Microsoft Onedrive, and even Google. I Can make posts to the forums here which has to be in a string, so I know I am sending everything right, but no matter what I do I cannot send any files thru API with invision. this is becoming a really big problem as I am growing, I really need that API figured out. I believe someone (Was it you @Stuart Silvester ?) that was working on a new API system, or an alternative one that was mentioned in a different forum. I would like to try that one if it is possible and ready. Because I'm pretty certain that either this API setup only works for PHP or is just not working in some areas. I can "GET" any and all information without any issues. It is the "POST" that is the issue. I also have another website on my server, I use Xenforo, and I can post to it just fine with files. I really enjoy invision, but I'm lost how to make this work and sadly this system seems to be moving in a direction I am not wanting to go in, (Cloud and almost forum alone) and that is an issue. The forum system here is 100% unbeatable and that's wonderful, but forums are not the main focus on my community. I host a video game community so desktop apps are the main focus, making games able to upload and download directly from my website is becoming a requirement and I cannot mate that happen, and so far I haven't found any professional who can either. I may add I have made many applications now that my community used, strictly based off of the API. this being said nothing can post anything except a string to the forum, but they get all the information in the world.
-
Tested with same result. private IEnumerator UploadMod(string A, string B) { Debug.Log("A: "+A+"; B: "+B); Byte[] bytes = File.ReadAllBytes(A); String file = Convert.ToBase64String(bytes); var url = "https://MySite.com/api/downloads/files"; WWWForm content = new WWWForm(); content.AddField("category", "390"); content.AddField("files", file); content.AddField("author", "3"); content.AddField("title", ModName.text); content.AddField("description", Description.text); content.AddField("version", Version.text); UnityWebRequest uwr = UnityWebRequest.Post(url, content); uwr.SetRequestHeader("Authorization", "Bearer " + BearerID); yield return uwr.SendWebRequest(); if (uwr.result == UnityWebRequest.Result.ConnectionError) { Debug.Log("Error While Sending for User info: " + uwr.error); } else { string result = uwr.downloadHandler.text; string FullTXT = result.Replace(@"\", string.Empty); Debug.Log(FullTXT); } uwr.Dispose(); } Tested, same result. private IEnumerator UploadMod(string A, string B) { Debug.Log("A: "+A+"; B: "+B); string[] path = new string[1]; path[0] = A; var url = "https://MySite.com/api/downloads/files"; UnityWebRequest[] files = new UnityWebRequest[path.Length]; WWWForm content = new WWWForm(); for (int i = 0; i < files.Length; i++) { files[i] = UnityWebRequest.Get(path[i]); yield return files[i].SendWebRequest(); content.AddBinaryData("files", files[i].downloadHandler.data, Path.GetFileName(path[i])); } content.AddBinaryData("files", file, B, "application/zip"); content.AddField("category", "390"); content.AddField("author", "3"); content.AddField("title", ModName.text); content.AddField("description", Description.text); content.AddField("version", Version.text); UnityWebRequest uwr = UnityWebRequest.Post(url, content); uwr.SetRequestHeader("Authorization", "Bearer " + BearerID); yield return uwr.SendWebRequest(); if (uwr.result == UnityWebRequest.Result.ConnectionError) { Debug.Log("Error While Sending for User info: " + uwr.error); } else { string result = uwr.downloadHandler.text; string FullTXT = result.Replace(@"\", string.Empty); Debug.Log(FullTXT); } uwr.Dispose(); }
-
Marc reacted to a post in a topic: RSS Feed Import to Forum Topic not attaching images
-
Clover13 reacted to a post in a topic: RSS Feed Import to Forum Topic not attaching images
-
I come again with struggles using the API. I can use the API to post Topics and a few other things, but when it comes to POSTing... I get pretty aggravated because on one app we have to send data one way, but in another app, we have to send the exact same file in a different form, this makes things VERY complicated! I apologize, as I usually wait until I exhausted all my resources before coming here and asking for help, and by this point I realize im just angry, and I try not to show it, but I still vent a little. The issue... So I am making an App for my website, which hosts video games and Mods for games. I made a "Uploader" tool that can be installed in a game so people can download from my site (Done!) Browse content on my site (Done) and now it is time for uploading to my site (error). I am trying to do the basic and upload a file to the "Downloads" app using the API. I am using C# as this is a desktop app, and I am using unity. My Code: private IEnumerator UploadMod(string A, string B) { var url = "https://MySite.com/api/downloads/files"; //<-- Not my actual address var bytes = System.IO.File.ReadAllBytes(A); WWWForm content = new WWWForm(); content.AddBinaryData("files", bytes, B, "application/zip"); content.AddField("category", "390"); content.AddField("author", "3"); content.AddField("title", ModName.text); content.AddField("description", Description.text); content.AddField("version", Version.text); UnityWebRequest uwr = UnityWebRequest.Post(url, content); uwr.SetRequestHeader("Authorization", "Bearer " + BearerID); yield return uwr.SendWebRequest(); if (uwr.result == UnityWebRequest.Result.ConnectionError) { Debug.Log("Error While Uploading Mod: " + uwr.error); } else { string result = uwr.downloadHandler.text; string FullTXT = result.Replace(@"\", string.Empty); Debug.Log(FullTXT); } } The error I get is of course: { "errorCode": "1L296/B", "errorMessage": "NO_FILES" } The only thing I can think of is maybe I have to send files in a different format? Anyone have any clue? Here is the source for my madness: Unity - Scripting API: WWWForm.AddBinaryData (unity3d.com)
-
RSS Feed Import to Forum Topic not attaching images
Schaken replied to Clover13's topic in Classic self-hosted technical help
I personally use https://rss.app/ and it does a very good job. you can have a bunch of different RSS setups for free and it has a RSS builder. I have used it for about 4 years now. To add to that I made an app that web crawls the RSS site and grabs the content more to my needs and rebuilds my forum post that way I want AFTER the RSS has been initially grabbed. RSS is REALLY cool, but using API's and Webhooks are way better when you are able to use them. -
The PHP is too different, this plugin just wont work anymore.
-
Daniel F reacted to a post in a topic: Invision Community Insight: Deprecation Communication, March Release and more.
-
@Daniel F you are awesome. As you know, I try real hard to make things look pretty, it tends to sell better. When im getting API's for forum categories, I would love to be able to grab the category image, and/or Icon. Same with gallery. People usually dont read as often as they just look for pictures, and the Invision system has functionality for this, but not in the API. For example, I would like to grab images from here. I can simply make them in my app, but if this ever changes on my site, I will have to update my app. And of course, as our earlier conversation, maybe a different way to upload images to the gallery. most other API I can upload as objects, which I can do this fine. but in the gallery for some reason I am really struggling to make it an encoded base64 image. and one that I almost forgot about... I would love for a way to upload images in topics. for example how I uploaded those images just now, I would love to do that with the API, granted I could upload to a 3rd party and just enter HTML to make it happen... but then I have to rely on 3rd party services and they delete images pretty fast and anyone reviewing topics will see tons of broken images.
-
Rest API not accepting Base64 Encoded image
Schaken replied to Schaken's topic in Developer Connection
Doing some google search.. $content = file_get_contents( $img); // encode it $content = base64_encode( $content); this part you entered, is the same as this in C#: StreamReader sr = new StreamReader(filePath); string sContentsa = sr.ReadToEnd(); sr.Close(); and public static string EncodeTo64(string toEncode) { byte[] toEncodeAsBytes = Encoding.ASCII.GetBytes(toEncode); return Convert.ToBase64String(toEncodeAsBytes); } So I tried this.. StreamReader sr = new StreamReader(filePath); string sContentsa = sr.ReadToEnd(); sr.Close(); Dictionary<string, string> content = new Dictionary<string, string>(); content.Add("category", "27"); content.Add("image", EncodeTo64(sContentsa)); content.Add("caption", ImageTitle.text); content.Add("filename", ImageTitle.text); content.Add("description", ImageDescription.text); using (UnityWebRequest www = UnityWebRequest.Post("https://XXXXXXXXXXX.com/api/gallery/images", content)) { www.SetRequestHeader("Authorization", "Bearer " + OAH.BearerID); yield return www.SendWebRequest(); if (www.result == UnityWebRequest.Result.ConnectionError) { Debug.Log("Error While Sending TEST: " + www.error); } else { string result = www.downloadHandler.text; string FullTXT = System.Text.RegularExpressions.Regex.Unescape(result); Debug.Log("TEST: " + FullTXT); } } public static string EncodeTo64(string toEncode) { byte[] toEncodeAsBytes = Encoding.ASCII.GetBytes(toEncode); return Convert.ToBase64String(toEncodeAsBytes); } And goofy enough I still got the exact same result. Do you think there may be a setting that I have set wrong in my ACP? the only thing I get in my ACP is this: I am starting to think maybe the code is right, but maybe I have something in my ACP set to block it on accident. -
Mike Mc reacted to a post in a topic: [CJ] Downloads Plus (Support Topic)
-
Adriano Faria reacted to a post in a topic: Notifications
-
Nigel Moore reacted to a post in a topic: Notifications
-
Schaken reacted to a post in a topic: Notifications
-
Nigel Moore reacted to a post in a topic: Notifications
-
mine is set up so only admin and moderators only can use it.