dropbox - get an {"error": "Invalid origin"} when i try to upload a file - dropbox-api

I was try to upload a file using the Drop box Saver as following:
"https://www.dropbox.com/developers/dropins/saver"
I see the Drop box saver button and when I'm clicking on it I get an error: {"error": "Invalid origin"} in a popup...
I also added to the "Drop-ins domains the local host ip,127.0.0.1
In the popup window that open when clicking on the button there is the uri:
https://www.dropbox.com/saver?origin=file%3A%2F%2F&app_key=undefined&version=2
Maybe the problem is that after the word "file" there are the following characters %3A%2F%2F and there is no file name or location...
app_key is undefine although i added it
What can i do?

It looks like you're opening your HTML directly from the file system instead of running a web server. I believe you'll need to actually run a web server (could be as simple as python -m SimpleHTTPServer) so the URL in the address bar starts with http (or https) and has a domain.

Related

Using Lucee Server with Command Box problems accessing Server Administration page

I recently downloaded CommandBox to try to set up a Lucee Server. I have a folder called LuceeSever with an Index.cfm page. When I type the command "box server start" it opens a window at this address: http://127.0.0.1:54613 displaying my index.cfm page. Cool.
But I would like to connect a datasource and I would like to do this thorough the server admin panel that everyone else says to use. So when I try to access http://127.0.0.1:54613/lucee/admin/server.cfm I get this screen:
So I created a password.txt file that contains 1 line of plaintext that is the password I wanted to use. So my directory looks like this:
LuceeServer>
index.cfm
password.txt
In which index.cfm and password.txt are at the same level. When I click import file the screen reloads and nothing happens.
I assume I have things set up incorrectly. I've never used commandbox before and I dont really know what I'm doing.
You can bypass this entirely by using CFConfig. You can either specify the adminPassword in your .cfconfig.json file
{
"adminPassword":"myPass"
}
or you can install commandbox-dotenv and set a global .env file that has a cfconfig_adminPassword key.
~/.box.env
# Add environment variables to be loaded into CommandBox when it starts
# Variables are in the form of foo=bar, one per line
cfconfig_adminPassword=myPass
Disclaimer: I am the lead developer of CommandBox and the CFConfig module.
When you run your server with CommandBox, click on its tray icon in the right corner of your desktop, click open and then the server home folder like shown on the image below:
Then navigate to /WEB-INF/lucee-server/context/ and place your password.txt file there. Then go back to lucees server admin page in your browser and click the "import file" button to import the password.txt file.
Your password.txt needs to go in the "root Lucee server directory", which isn't the same as your site's web root (which wouldn't be a very secure place to put it). In CommandBox the location is a bit obscure, but you can find it with the following command:
server info property=serverHomeDirectory

Google PHP AppEngine - Deployment Issue with PHP file not being uploaded

I have a very simple PHP app that allows a User to enter names of Cities or Zip-codes into a search box, and the User gets auto-complete suggestions based on data stored in my Google CloudSQL server.
index.html - Renders a simple search box where users can enter search keys and they get auto-complete suggestions. Accomplished via Twitter's typeahead.js library (jQuery plugin).
city.php - PHP file that acts as a translation layer. Receives request from the browser and initiates connection to my Google CloudSQL server where I have a simple database with some city and zipcode data. Returns the data back to the browser as an array.
This works on my local Mac OS X Apache server. I am trying to get this setup to work on Google PHP AppEngine. I created an app.yaml file that looks like this:
runtime: php55
api_version: 2
threadsafe: true
handlers:
- url: /
static_files: index.html
upload: index.html
- url: /(.*)
static_files: www/\1
upload: (.*)
- url: /(.+\.php)$
script: \1
This is where I run into an issue. When I run gcloud app deploy from my local folder (which houses index.html, city.php, and app.yaml), I get the following message in the logs.
Some files were skipped. Pass `--verbosity=info` to see which ones.
You may also view the gcloud log file, found at
[/Users/arjunshah/.config/gcloud/logs/2016.11.13/12.31.04.137587.log].
When I run gcloud app deploy with log verbosity, I see the following:
INFO: Could not find any remote repositories associated with [/Users/arjunshah/Documents/autocomplete]. Cloud diagnostic tools may not be able to display the correct source code for this deployment.
File upload done.
INFO: Manifest: [{'app.yaml': {'sourceUrl': 'https://storage.googleapis.com/staging.ashah-146101.appspot.com/abbe3c7fc03eb43497686990488c54e2ae0533ea', 'sha1Sum': 'abbe3c7fc03eb43497686990488c54e2ae0533ea'}, 'index.html': {'sourceUrl': 'https://storage.googleapis.com/staging.ashah-146101.appspot.com/1865620cc55de1902c2a9636df601f532cb2657a', 'sha1Sum': '1865620cc55de1902c2a9636df601f532cb2657a'}, 'city.php': {'sourceUrl': 'https://storage.googleapis.com/staging.ashah-146101.appspot.com/64999cc8da06416a54be99c43e6e017aa0c1d01a', 'sha1Sum': '64999cc8da06416a54be99c43e6e017aa0c1d01a'}}]
Updating service [default]...
INFO: Previous default version [ashah-146101/default/20161113t122802] is an automatically scaled standard environment app, so not stopping it.
The index.html page loads fine, but when I try to enter names of cities (that I know are in the database), I see the following error in the Google Browser Inspect Element console.
Failed to load resource: https://ashah-146101.appspot.com/city.php?query=P the server responded with a status of 404 ()
Please help!

How to load local files from user selected directory in chrome app

I am developing chrome app , in my app user can download external content to their local directory , to access user's file system i am using chrome.FileSystem API ,i can access user's local directory and i am also able to write downloaded content to their directory by keeping user selected directory to localStorage.
My problem is i want to open these files in main html file using either webview / iframe , it will be better if its possible with iframe but i am getting error in both cases -
to get full path i am using below code -
chrome.fileSystem.getDisplayPath(chosenEntry, function(path) {
console.log("path"+path);
// for now i am adding static path to it for testing purpose
var finalPath = path+'/folder/index.html'; //Here finalPath is a valid path , can be accessible from browser
});
if i load it using iFrame -
Refused to frame 'path' because it violates the following Content Security Policy directive: "frame-src 'self' blob: filesystem: data: chrome-extension-resource:".
When i tried using webview -
: The load has aborted with error -301: ERR_DISALLOWED_URL_SCHEME.
I have also tried by giving permission in manifest.json file -
"permissions": [
"file:///*"
]
Note : user may have number of downloaded content each with their own folder , so i have to open any of these according to user action.
It's not the most elegant solution, but running a web server inside chrome your chrome app and pointing the webview at the web server URL will work.

How do I alter the default URL location of EasyPHP

EasyPHPs homepage is accessed from : http://127.0.0.1/home/.
Virtual Host manager sets a local domain name to redirect to 127.0.0.1 in the hosts file.
When I navigate to 'mylocaldomain.com/home/' I get an error 'The requested URL was not found on this server.' because '/home/index.php' is used for the Admin Panel of EasyPHP.
I need to use '/home/' in my local domains, so I want to try and change the default URL that EasyPHP homepage is using.
Any ideas?
I just had this problem and ran across your question. This is how you solve it:
Access your EasyPHP Apache config file (on Windows, I right-click on the taskbar icon, go to Configuration, then click Apache)
Look for the line Alias /home "${path}/binaries/home" - Mine was at line 359
Change the first /home to /something-you-won't-think-to-use-on-your-websites
Restart the server
That should do it

"URL not found" error at my localhost setup of TYPO3 website.

I have setup TYPO3 successfully on my local server. But I am having problem when clicking on any menu item: It's showing "url not found on server".
When I type in the URL manually into the browser it shows the page. It's only having problems when redirecting after clicking on a page item at any frontend website page.
That might be related to the domain config or RealURL... or both ;)
Do you use RealURL? Or do you use the standard url config?
If links to sub pages look like index.php?id=12345 you are using the standard config.
My guess is that the local DNS ("hosts file") is not configured correctly.
With the hosts file you can simulate how the web site will appear when it's online, hooked up to a "real/global" DNS. (Not quite, but in a nutshell)
So if you set up Typo3 to be reached under http://www.example.com/ you need to tell your local DNS ("hosts file") to route a request to http://www.example.com/ to your local host e.g. http://127.0.0.1/ . In that case your host file needs an entry like so:
127.0.0.1 http://www.example.com/
What Domain do you enter to reach your web site? Where do the links from the menu link to?
If you wanna know mor about the "hosts file" look here:
http://accs-net.com/hosts/how_to_use_hosts.html
If you can log in into the TYPO3 backend (/typo3/) and can access the frondend through /index.php, but not through the generated menu links, then RewriteRules for mod_rewrite don't apply.
Usually TYPO3's installer should detect this configuration and disable RealURL, which is responsible for generating such nice looking URLs (instead of index.php?id=123). It seems like this failed (or you copied everything afterwards without the .htaccess file?).
Make sure that you have TYPO3's .htaccess file in place in the root directory of your installation. If this is the case, make sure that mod_rewrite is enabled in your Apache config.