Can't use tempurl with put method to upload - upload

I have installed keystone and swift and had proxy-server.conf configured.
I can generate a temp url to download a object without any promblem..
But when I use the same way(I did changed the method into "PUT") to generate a temp url to upload a object I got error 401...The log said can't find authentication head...
I had tried all the way that I can think of to solve the problem but I got no luck:<

It turned out that was a silly problem caused by system date between two servers are not sync...

Related

Grails 3 web interface with zip upload via form to a folder on the server

I'm trying to create a Grails 3 web interface with an upload form that writes zip files to a folder on the server.
I have already tried a lot of plugins or solutions that can be found here but nothing seems to work.
My code can be found on github (https://github.com/rm93/BIGC).
Would anyone know a solution that I could apply?
I have found a solution to my problem. Instead to give a path to the transferTo method i now I give it a new file.
fileUpload.transferTo(new File("/path/to/folder/data.zip"))

laravel 5.1 renaming file before uploading on s3

For safety reasons I would like to rename the files submitted to my application before uploading them to S3. For local storage I can use Storage::move afterwards. But for S3 I am having trouble. How do I do it? Also, instead of using move is it possible to rename them before storing? Right no my app renames the files without any actions to something like phpK69RGR.jpg May be I can just configure the random string method? I also tried using the php rename command before upload but my webservice started erroring out. I know its a very basic question but for some reason I am having trouble with it.
This is outlined in the docs.
$request->file('photo')->move($destinationPath, $fileName);
$fileName is an optional parameter that renames the file.
So with that, you could simply place this inside your controller:
//Generate random name
$fileName = str_random(30);
$request->file('photo')->move($destinationPath, $fileName);

IOS (Swift) How to explore persistent file(s) during debug session?

First post on StackOverflow, after extensively using it for a long time.
I'm building a small app (just to lear swift), and I have troubles with making some data persistent. I use NSCoding to achieve that. The problem is that when saving, the function NSKeyedArchiver.archiveRootObject() return true (so apparently it worked), but when, later, I try to retrieve these saved informations, the result of NSKeyedUnarchiver.unarchiveObjectWithFile() is nil.
Without posting all my code, I was just wondering if it were possible to explore the file in which persistent data are stored during a debug session. That would allow me to check whether I have a problem with the saving or the loading part of the process, and see if the data are indeed stored in the right file.
Thanks,
Lb
Per Apple Documentation, you get a nil with unarchiveObjectWithFile when there is no file at the mentioned path. I would advise to check your file path where you are archiving and saving your object.
As for the debugging, follow this:
Print the file path when you are archiving and saving the object. So in this NSKeyedArchiver.archiveRootObject(myObject, toFile: filePath) print filePath.
Open your terminal app and execute open <filePath> command to open the file path where data is being saved.
Check out if your data file is created in there with right archiving.

Loading/Downloading a URL with a space followed by a number

I have a few files I'm trying to download in the following format:
http://someserver.com/movie_title 5.1.12.mov
When I place the following code on it:
mediaURL =[[mediaURL stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
I get the following result:
http://someserver.com/movie_title%205.1.12.mov
If I copy paste that into my browser on any machine, it downloads correctly. However, It won't download as an NSURL on my project; it just fails.
Any suggestions? I'm guessing it's something silly that I'm forgetting.
If I were you I would confirm that the escaping is the problem, it could be some other part of your code that is failing (if you have access to the server manually rename the file with only characters.mov)
If you try this and it works, make sure you are using the expected headers and http method (POST or GET).
Else please put the code on git so we can download it and figure out what is wrong.
I've found that the server that the video was coming from did not support streaming capabilities. I tried putting the same link on my safari browser and the item did not stream.
Thanks everyone

Net::FTPPermError (500 I won't open a connection to 10.10...... (only to 174.12........)

I have a rails app deployed to heroku. I have used paperclipftp to upload files to an ftp server, as heroku doesn't give much features with file uploading. So when I try to upload a file and save a record, I get this error.
Net::FTPPermError (500 I won't open a connection to 10.10...... (only to 174.12........)
I don't know why this is coming up. After some searching I came to know that Heroku doesn't allow active FTP connections so tried to establish a passive connection by editing the paperclipftp file.
I added this line in its initialize block
#ftp.passive = #ftp_credentials[:passive] if #ftp_credentials.has_key?("passive") and passed a variable [passive:true] in my YAML config file. But still it doesn't work.
Please Help. Thanks in advance.
have you found an answer to your problem ? I'm facing the exact same issue and do not know how to bypass this. A solution could be to use Amazon S3 to save your file. I will check in this direction and let you know.
Regards,
Luc
EDIT (28/03/11): S3 is definitively a great solution, very easy to setup. On top of this it's really cheap if you do not have tons of pictures to upload

Resources